Nextcloud PHP API (master)

ITagManager

Factory class creating instances of \OCP\ITags

A tag can be e.g. 'Family', 'Work', 'Chore', 'Special Occation' or anything else that is either parsed from a vobject or that the user chooses to add. Tag names are not case-sensitive, but will be saved with the case they are entered in. If a user already has a tag 'family' for a type, and tries to add a tag named 'Family' it will be silently ignored.

Tags
since
6.0.0

Table of Contents

Methods

load()  : ITags
Create a new \OCP\ITags instance and load tags from db for the current user.

Methods

load()

Create a new \OCP\ITags instance and load tags from db for the current user.

public load(string $type[, array<string|int, mixed> $defaultTags = [] ][, bool $includeShared = false ][, string $userId = null ]) : ITags
Parameters
$type : string

The type identifier e.g. 'contact' or 'event'.

$defaultTags : array<string|int, mixed> = []

An array of default tags to be used if none are stored.

$includeShared : bool = false

Whether to include tags for items shared with this user by others. - always false since 20.0.0

$userId : string = null

user for which to retrieve the tags, defaults to the currently logged in user

Tags
see
ITags
since
6.0.0
  • parameter $includeShared and $userId were added in 8.0.0 - $includeShared is always false since 20.0.0
Return values
ITags

        
On this page

Search results