Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-10-16 18:48:16 +0300
committerJulius Härtl <jus@bitgrid.net>2019-03-01 22:56:15 +0300
commit65a9ab47ea233701b559d08d89e36649a3d5a30b (patch)
tree0315b4b1461e06cd9d968bb024bcdc97234ae6d1 /lib
parent69b530a44230028c278bda94984b7aaacd22a8a1 (diff)
Add a controller with the most important methods
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Collaboration/Resources/Resource.php7
-rw-r--r--lib/public/Collaboration/Resources/CollectionException.php28
-rw-r--r--lib/public/Collaboration/Resources/IProvider.php1
-rw-r--r--lib/public/Collaboration/Resources/IResource.php3
-rw-r--r--lib/public/Collaboration/Resources/ResourceException.php1
5 files changed, 34 insertions, 6 deletions
diff --git a/lib/private/Collaboration/Resources/Resource.php b/lib/private/Collaboration/Resources/Resource.php
index f82ceff5596..0eda8ba55c2 100644
--- a/lib/private/Collaboration/Resources/Resource.php
+++ b/lib/private/Collaboration/Resources/Resource.php
@@ -66,19 +66,18 @@ class Resource implements IResource {
}
/**
- * @param IResource $resource
* @return ICollection[]
* @since 15.0.0
*/
- public function getCollections(IResource $resource): array {
+ public function getCollections(): array {
$collections = [];
$query = $this->connection->getQueryBuilder();
$query->select('collection_id')
->from('collres_resources')
- ->where($query->expr()->eq('resource_type', $query->createNamedParameter($resource->getType())))
- ->andWhere($query->expr()->eq('resource_id', $query->createNamedParameter($resource->getId())));
+ ->where($query->expr()->eq('resource_type', $query->createNamedParameter($this->getType())))
+ ->andWhere($query->expr()->eq('resource_id', $query->createNamedParameter($this->getId())));
$result = $query->execute();
while ($row = $result->fetch()) {
diff --git a/lib/public/Collaboration/Resources/CollectionException.php b/lib/public/Collaboration/Resources/CollectionException.php
new file mode 100644
index 00000000000..f5130d37d60
--- /dev/null
+++ b/lib/public/Collaboration/Resources/CollectionException.php
@@ -0,0 +1,28 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Collaboration\Resources;
+
+
+class CollectionException extends \RuntimeException {
+
+}
diff --git a/lib/public/Collaboration/Resources/IProvider.php b/lib/public/Collaboration/Resources/IProvider.php
index 06e2a6a81ee..eac92733dea 100644
--- a/lib/public/Collaboration/Resources/IProvider.php
+++ b/lib/public/Collaboration/Resources/IProvider.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com>
*
diff --git a/lib/public/Collaboration/Resources/IResource.php b/lib/public/Collaboration/Resources/IResource.php
index 42631bc27a8..9f8628c0d48 100644
--- a/lib/public/Collaboration/Resources/IResource.php
+++ b/lib/public/Collaboration/Resources/IResource.php
@@ -40,9 +40,8 @@ interface IResource {
public function getId(): string;
/**
- * @param IResource $resource
* @return ICollection[]
* @since 15.0.0
*/
- public function getCollections(IResource $resource): array;
+ public function getCollections(): array;
}
diff --git a/lib/public/Collaboration/Resources/ResourceException.php b/lib/public/Collaboration/Resources/ResourceException.php
index f31b2031a89..d03264bcef9 100644
--- a/lib/public/Collaboration/Resources/ResourceException.php
+++ b/lib/public/Collaboration/Resources/ResourceException.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com>
*