diff options
author | Joas Schilling <coding@schilljs.com> | 2023-10-12 12:25:54 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-10-13 08:38:19 +0200 |
commit | fc445a2eaa2f93ae7f55b3af8800a87a69480a66 (patch) | |
tree | e946fcdf356f133b7a8bfa23eaa1d57c135c5615 /lib | |
parent | b246d51cbc5105b9c4e85867297ee19f6d2459e5 (diff) | |
download | nextcloud-server-fc445a2eaa2f93ae7f55b3af8800a87a69480a66.tar.gz nextcloud-server-fc445a2eaa2f93ae7f55b3af8800a87a69480a66.zip |
feat(OCM): Add a way for apps to create a new IOCMResource
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/OCM/Model/OCMProvider.php | 8 | ||||
-rw-r--r-- | lib/public/OCM/IOCMProvider.php | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/OCM/Model/OCMProvider.php b/lib/private/OCM/Model/OCMProvider.php index 1a8d943f79f..a72dd282dad 100644 --- a/lib/private/OCM/Model/OCMProvider.php +++ b/lib/private/OCM/Model/OCMProvider.php @@ -96,6 +96,14 @@ class OCMProvider implements IOCMProvider { } /** + * create a new resource to later add it with {@see IOCMProvider::addResourceType()} + * @return IOCMResource + */ + public function createNewResourceType(): IOCMResource { + return new OCMResource(); + } + + /** * @param IOCMResource $resource * * @return $this diff --git a/lib/public/OCM/IOCMProvider.php b/lib/public/OCM/IOCMProvider.php index 6eebf13a589..6df7eed370c 100644 --- a/lib/public/OCM/IOCMProvider.php +++ b/lib/public/OCM/IOCMProvider.php @@ -91,6 +91,13 @@ interface IOCMProvider extends JsonSerializable { public function getEndPoint(): string; /** + * create a new resource to later add it with {@see addResourceType()} + * @return IOCMResource + * @since 28.0.0 + */ + public function createNewResourceType(): IOCMResource; + + /** * add a single resource to the object * * @param IOCMResource $resource |