summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-11-26 15:49:14 +0100
committerVincent Petry <pvince81@owncloud.com>2015-11-27 17:54:29 +0100
commitb666367a7902c5d935f7aef1704711b8695690b2 (patch)
treefc65f2208512f53e8390c55d84bfcf54ab60fdb7 /lib/public
parent129ec4fb4054f2f145285772b94d7d5e1cd56286 (diff)
downloadnextcloud-server-b666367a7902c5d935f7aef1704711b8695690b2.tar.gz
nextcloud-server-b666367a7902c5d935f7aef1704711b8695690b2.zip
Added system tags data structure and PHP side managers
Added SystemTagManager and SystemTagObjectMapper
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/iservercontainer.php18
-rw-r--r--lib/public/systemtag/isystemtag.php2
-rw-r--r--lib/public/systemtag/isystemtagmanager.php (renamed from lib/public/systemtag/isystemtagsmanager.php)10
-rw-r--r--lib/public/systemtag/isystemtagobjectmapper.php10
4 files changed, 35 insertions, 5 deletions
diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php
index d85f812b2e7..7cb2672254b 100644
--- a/lib/public/iservercontainer.php
+++ b/lib/public/iservercontainer.php
@@ -470,4 +470,22 @@ interface IServerContainer {
* @since 8.2.0
*/
public function getNotificationManager();
+
+ /**
+ * Returns the system-tag manager
+ *
+ * @return \OCP\SystemTag\ISystemTagManager
+ *
+ * @since 9.0.0
+ */
+ public function getSystemTagManager();
+
+ /**
+ * Returns the system-tag object mapper
+ *
+ * @return \OCP\SystemTag\ISystemTagObjectMapper
+ *
+ * @since 9.0.0
+ */
+ public function getSystemTagObjectMapper();
}
diff --git a/lib/public/systemtag/isystemtag.php b/lib/public/systemtag/isystemtag.php
index 76a812f38dc..26609fd8af7 100644
--- a/lib/public/systemtag/isystemtag.php
+++ b/lib/public/systemtag/isystemtag.php
@@ -62,7 +62,7 @@ interface ISystemTag {
*
* @since 9.0.0
*/
- public function isUserAsssignable();
+ public function isUserAssignable();
}
diff --git a/lib/public/systemtag/isystemtagsmanager.php b/lib/public/systemtag/isystemtagmanager.php
index df59cc48d52..2020ec52900 100644
--- a/lib/public/systemtag/isystemtagsmanager.php
+++ b/lib/public/systemtag/isystemtagmanager.php
@@ -31,9 +31,11 @@ interface ISystemTagManager {
/**
* Returns the tag objects matching the given tag ids.
*
- * @param array|string $tagIds The ID or array of IDs of the tags to retrieve
+ * @param array|string $tagIds id or array of unique ids of the tag to retrieve
*
- * @return \OCP\SystemTag\ISystemTag[] array of system tags or empty array if none found
+ * @return \OCP\SystemTag\ISystemTag[] array of system tags with tag id as key
+ *
+ * @throws \OCP\SystemTag\TagNotFoundException if at least one given tag id did no exist
*
* @since 9.0.0
*/
@@ -72,14 +74,14 @@ interface ISystemTagManager {
/**
* Returns all known tags, optionally filtered by visibility.
*
- * @param bool $visibleOnly whether to only return user visible tags
+ * @param bool|null $visibilityFilter filter by visibility if non-null
* @param string $nameSearchPattern optional search pattern for the tag name
*
* @return \OCP\SystemTag\ISystemTag[] array of system tags or empty array if none found
*
* @since 9.0.0
*/
- public function getAllTags($visibleOnly = false, $nameSearchPattern = null);
+ public function getAllTags($visibilityFilter = null, $nameSearchPattern = null);
/**
* Updates the given tag
diff --git a/lib/public/systemtag/isystemtagobjectmapper.php b/lib/public/systemtag/isystemtagobjectmapper.php
index 8c6c27c4846..e2ac1fab124 100644
--- a/lib/public/systemtag/isystemtagobjectmapper.php
+++ b/lib/public/systemtag/isystemtagobjectmapper.php
@@ -69,6 +69,11 @@ interface ISystemTagObjectMapper {
/**
* Assign the given tags to the given object.
*
+ * If at least one of the given tag ids doesn't exist, none of the tags
+ * will be assigned.
+ *
+ * If the relationship already existed, fail silently.
+ *
* @param string $objId object id
* @param string $objectType object type
* @param string|array $tagIds tag id or array of tag ids to assign
@@ -83,6 +88,11 @@ interface ISystemTagObjectMapper {
/**
* Unassign the given tags from the given object.
*
+ * If at least one of the given tag ids doesn't exist, none of the tags
+ * will be unassigned.
+ *
+ * If the relationship did not exist in the first place, fail silently.
+ *
* @param string $objId object id
* @param string $objectType object type
* @param string|array $tagIds tag id or array of tag ids to unassign