ISystemTagManager¶
-
interface
OCP\SystemTag\
ISystemTagManager
¶ - Public interface to access and manage system-wide tags.
Implemented by: OC\SystemTag\SystemTagManager
Source: lib/public/SystemTag/ISystemTagManager.php#37
Methods¶
-
public
OCP\SystemTag\ISystemTagManager::
getTagsByIds
($tagIds)¶ - Returns the tag objects matching the given tag ids.
Source: Parameters: - $tagIds (array | string) id or array of unique ids of the tag to retrieve
Returns: \OCP\SystemTag\ISystemTag[]
array of system tags with tag id as keyThrows: \InvalidArgumentException
if at least one given tag ids is invalid (string instead of integer, etc.)Throws: \OCP\SystemTag\TagNotFoundException
if at least one given tag ids did no exist The message contains a json_encoded array of the ids that could not be foundThrows: \InvalidArgumentException
if at least one given tag ids is invalid (string instead of integer, etc.)Throws: \OCP\SystemTag\TagNotFoundException
if at least one given tag ids did no exist The message contains a json_encoded array of the ids that could not be foundSince: 9.0.0
-
public
OCP\SystemTag\ISystemTagManager::
getTag
($tagName, $userVisible, $userAssignable)¶ - Returns the tag object matching the given attributes.
Source: Parameters: - $tagName (string) tag name
- $userVisible (bool) whether the tag is visible by users
- $userAssignable (bool) whether the tag is assignable by users
Returns: \OCP\SystemTag\ISystemTag
system tagThrows: \OCP\SystemTag\TagNotFoundException
if tag does not existSince: 9.0.0
-
public
OCP\SystemTag\ISystemTagManager::
createTag
($tagName, $userVisible, $userAssignable)¶ - Creates the tag object using the given attributes.
Source: Parameters: - $tagName (string) tag name
- $userVisible (bool) whether the tag is visible by users
- $userAssignable (bool) whether the tag is assignable by users
Returns: \OCP\SystemTag\ISystemTag
system tagThrows: \OCP\SystemTag\TagAlreadyExistsException
if tag already existsSince: 9.0.0
-
public
OCP\SystemTag\ISystemTagManager::
getAllTags
($visibilityFilter=null, $nameSearchPattern=null)¶ - Returns all known tags, optionally filtered by visibility.
Source: Parameters: - $visibilityFilter (bool | null) filter by visibility if non-null
- $nameSearchPattern (string) optional search pattern for the tag name
Returns: \OCP\SystemTag\ISystemTag[]
array of system tags or empty array if none foundSince: 9.0.0
-
public
OCP\SystemTag\ISystemTagManager::
updateTag
($tagId, $newName, $userVisible, $userAssignable)¶ - Updates the given tag
Source: Parameters: - $tagId (string) tag id
- $newName (string) the new tag name
- $userVisible (bool) whether the tag is visible by users
- $userAssignable (bool) whether the tag is assignable by users
Throws: \OCP\SystemTag\TagNotFoundException
if tag with the given id does not existThrows: \OCP\SystemTag\TagAlreadyExistsException
if there is already another tag with the same attributesThrows: \OCP\SystemTag\TagNotFoundException
if tag with the given id does not existThrows: \OCP\SystemTag\TagAlreadyExistsException
if there is already another tag with the same attributesSince: 9.0.0
-
public
OCP\SystemTag\ISystemTagManager::
deleteTags
($tagIds)¶ - Delete the given tags from the database and all their relationships.
Source: Parameters: - $tagIds (string | array) array of tag ids
Throws: \OCP\SystemTag\TagNotFoundException
if at least one tag did not existSince: 9.0.0
-
public
OCP\SystemTag\ISystemTagManager::
canUserAssignTag
($tag, $user)¶ - Checks whether the given user is allowed to assign/unassign the tag with thegiven id.
Source: Parameters: - $tag (
OCP\SystemTag\ISystemTag
) tag to check permission for - $user (
OCP\IUser
) user to check permission for
Returns: bool if the user is allowed to assign/unassign the tag, false otherwise
Since: 9.1.0
- $tag (
-
public
OCP\SystemTag\ISystemTagManager::
canUserSeeTag
($tag, $user)¶ - Checks whether the given user is allowed to see the tag with the given id.
Source: Parameters: - $tag (
OCP\SystemTag\ISystemTag
) tag to check permission for - $user (
OCP\IUser
) user to check permission for
Returns: bool if the user can see the tag, false otherwise
Since: 9.1.0
- $tag (
-
public
OCP\SystemTag\ISystemTagManager::
setTagGroups
($tag, $groupIds)¶ - Set groups that can assign a given tag.
Source: Parameters: - $tag (
OCP\SystemTag\ISystemTag
) tag for group assignment - $groupIds (string[]) group ids of groups that can assign/unassign the tag
Since: 9.1.0
- $tag (
-
public
OCP\SystemTag\ISystemTagManager::
getTagGroups
($tag)¶ - Get groups that can assign a given tag.
Source: Parameters: - $tag (
OCP\SystemTag\ISystemTag
) tag for group assignment
Returns: string[] group ids of groups that can assign/unassign the tag
Since: 9.1.0
- $tag (