88 */
99namespace OCP \SystemTag ;
1010
11+ use OCP \AppFramework \Attribute \Consumable ;
12+
1113/**
1214 * Public interface to access and manage system-wide tags.
1315 *
1416 * @since 9.0.0
1517 */
18+ #[Consumable(since: '9.0.0 ' )]
1619interface ISystemTagObjectMapper {
1720 /**
1821 * Get a list of tag ids for the given object ids.
1922 *
2023 * This returns an array that maps object id to tag ids
24+ *
25+ * ```
2126 * [
22- * 1 => array( 'id1', 'id2') ,
23- * 2 => array( 'id3', 'id2') ,
24- * 3 => array( 'id5') ,
25- * 4 => array()
27+ * 1 => [ 'id1', 'id2'] ,
28+ * 2 => [ 'id3', 'id2'] ,
29+ * 3 => [ 'id5'] ,
30+ * 4 => []
2631 * ]
32+ * ```
2733 *
2834 * Untagged objects will have an empty array associated.
2935 *
30- * @param string|array $objIds object ids
36+ * @param string|list<string> $objIds object ids
3137 * @param string $objectType object type
3238 *
33- * @return array with object id as key and an array
39+ * @return array<string, list<string>> with object id as key and an array
3440 * of tag ids as value
3541 *
3642 * @since 9.0.0
@@ -40,12 +46,12 @@ public function getTagIdsForObjects($objIds, string $objectType): array;
4046 /**
4147 * Get a list of objects tagged with $tagIds.
4248 *
43- * @param string|array $tagIds Tag id or array of tag ids.
49+ * @param string|list<string> $tagIds Tag id or array of tag ids.
4450 * @param string $objectType object type
4551 * @param int $limit Count of object ids you want to get
4652 * @param string $offset The last object id you already received
4753 *
48- * @return string[] array of object ids or empty array if none found
54+ * @return list< string> array of object ids or empty array if none found
4955 *
5056 * @throws TagNotFoundException if at least one of the
5157 * given tags does not exist
@@ -66,7 +72,7 @@ public function getObjectIdsForTags($tagIds, string $objectType, int $limit = 0,
6672 *
6773 * @param string $objId object id
6874 * @param string $objectType object type
69- * @param string|array $tagIds tag id or array of tag ids to assign
75+ * @param string|list<string> $tagIds tag id or array of tag ids to assign
7076 *
7177 * @throws TagNotFoundException if at least one of the
7278 * given tags does not exist
@@ -85,7 +91,7 @@ public function assignTags(string $objId, string $objectType, $tagIds);
8591 *
8692 * @param string $objId object id
8793 * @param string $objectType object type
88- * @param string|array $tagIds tag id or array of tag ids to unassign
94+ * @param string|list<string> $tagIds tag id or array of tag ids to unassign
8995 *
9096 * @throws TagNotFoundException if at least one of the
9197 * given tags does not exist
@@ -97,7 +103,7 @@ public function unassignTags(string $objId, string $objectType, $tagIds);
97103 /**
98104 * Checks whether the given objects have the given tag.
99105 *
100- * @param string|array $objIds object ids
106+ * @param string|list<string> $objIds object ids
101107 * @param string $objectType object type
102108 * @param string $tagId tag id to check
103109 * @param bool $all true to check that ALL objects have the tag assigned,
@@ -128,7 +134,7 @@ public function getAvailableObjectTypes(): array;
128134 *
129135 * @param string $tagId tag id
130136 * @param string $objectType object type
131- * @param string[] $objectIds list of object ids
137+ * @param list< string> $objectIds list of object ids
132138 *
133139 * @throws TagNotFoundException if the tag does not exist
134140 * @since 31.0.0
0 commit comments