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:

lib/public/SystemTag/ISystemTagManager.php#52

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 key

Throws:

\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 found

Throws:

\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 found

Since:

9.0.0

public OCP\SystemTag\ISystemTagManager::getTag($tagName, $userVisible, $userAssignable)
Returns the tag object matching the given attributes.
Source:

lib/public/SystemTag/ISystemTagManager.php#67

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 tag

Throws:

\OCP\SystemTag\TagNotFoundException if tag does not exist

Since:

9.0.0

public OCP\SystemTag\ISystemTagManager::createTag($tagName, $userVisible, $userAssignable)
Creates the tag object using the given attributes.
Source:

lib/public/SystemTag/ISystemTagManager.php#82

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 tag

Throws:

\OCP\SystemTag\TagAlreadyExistsException if tag already exists

Since:

9.0.0

public OCP\SystemTag\ISystemTagManager::getAllTags($visibilityFilter=null, $nameSearchPattern=null)
Returns all known tags, optionally filtered by visibility.
Source:

lib/public/SystemTag/ISystemTagManager.php#94

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 found

Since:

9.0.0

public OCP\SystemTag\ISystemTagManager::updateTag($tagId, $newName, $userVisible, $userAssignable)
Updates the given tag
Source:

lib/public/SystemTag/ISystemTagManager.php#110

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 exist

Throws:

\OCP\SystemTag\TagAlreadyExistsException if there is already another tag with the same attributes

Throws:

\OCP\SystemTag\TagNotFoundException if tag with the given id does not exist

Throws:

\OCP\SystemTag\TagAlreadyExistsException if there is already another tag with the same attributes

Since:

9.0.0

public OCP\SystemTag\ISystemTagManager::deleteTags($tagIds)
Delete the given tags from the database and all their relationships.
Source:

lib/public/SystemTag/ISystemTagManager.php#121

Parameters:
  • $tagIds (string | array) array of tag ids
Throws:

\OCP\SystemTag\TagNotFoundException if at least one tag did not exist

Since:

9.0.0

public OCP\SystemTag\ISystemTagManager::canUserAssignTag($tag, $user)
Checks whether the given user is allowed to assign/unassign the tag with the
given id.
Source:

lib/public/SystemTag/ISystemTagManager.php#134

Parameters:
Returns:

bool if the user is allowed to assign/unassign the tag, false otherwise

Since:

9.1.0

public OCP\SystemTag\ISystemTagManager::canUserSeeTag($tag, $user)
Checks whether the given user is allowed to see the tag with the given id.
Source:

lib/public/SystemTag/ISystemTagManager.php#146

Parameters:
Returns:

bool if the user can see the tag, false otherwise

Since:

9.1.0

public OCP\SystemTag\ISystemTagManager::setTagGroups($tag, $groupIds)
Set groups that can assign a given tag.
Source:

lib/public/SystemTag/ISystemTagManager.php#156

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

public OCP\SystemTag\ISystemTagManager::getTagGroups($tag)
Get groups that can assign a given tag.
Source:

lib/public/SystemTag/ISystemTagManager.php#167

Parameters:
Returns:

string[] group ids of groups that can assign/unassign the tag

Since:

9.1.0