class Tag extends AbstractModel (View source)

Properties

protected AbstractDao $dao from AbstractModel
int $id
string $name
int $parentId
string $idPath
Tag[] $children
Tag $parent

Methods

Dao
getDao()

No description

setDao($dao)

No description

getResource() deprecated

No description

initDao(null $key = null, bool $forceDetection = false)

No description

static string|null
locateDaoClass(string $modelClass)

No description

$this
setValues(array $data = [])

No description

$this
setValue($key, $value)

No description

array
__sleep()

No description

mixed
__call($method, $args)

No description

__clone()

No description

array
getObjectVars()

returns object values without the dao

array
__debugInfo()

No description

void
beginTransaction()

No description

void
commit()

No description

void
rollBack()

No description

void
configure()

No description

array
getValidTableColumns(string $table, bool $cache)

No description

void
resetValidTableColumnsCache(string $table)

No description

static Tag|null
getById($id)

No description

static Tag[]
getTagsForElement($cType, $cId)

returns all assigned tags for element

static 
addTagToElement($cType, $cId, Tag $tag)

adds given tag to element

static 
removeTagFromElement($cType, $cId, Tag $tag)

removes given tag from element

static 
setTagsForElement($cType, $cId, array $tags)

sets given tags to element and removes all other tags to remove all tags from element, provide empty array of tags

static 
batchAssignTagsToElement($cType, array $cIds, array $tagIds, bool|false $replace = false)

No description

static array
getElementsForTag(Tag $tag, string $type, array $subtypes = [], array $classNames = [], bool $considerChildTags = false)

Retrieves all elements that have a specific tag or one of its child tags assigned

save()

No description

int
getId()

No description

Tag
setId(int $id)

No description

string
getName()

No description

Tag
setName(string $name)

No description

int
getParentId()

No description

Tag
setParentId(int $parentId)

No description

Tag
getParent()

No description

string
getIdPath()

No description

string
getFullIdPath()

No description

string
getNamePath(bool $includeOwnName = true)

No description

Tag[]
getChildren()

No description

bool
hasChildren()

No description

correctPath()

No description

Details

Dao getDao()

Return Value

Dao

AbstractModel setDao($dao)

Parameters

$dao

Return Value

AbstractModel

AbstractDao getResource() deprecated

deprecated

Return Value

AbstractDao

initDao(null $key = null, bool $forceDetection = false)

Parameters

null $key
bool $forceDetection

Exceptions

Exception

static string|null locateDaoClass(string $modelClass)

Parameters

string $modelClass

Return Value

string|null

$this setValues(array $data = [])

Parameters

array $data

Return Value

$this

$this setValue($key, $value)

Parameters

$key
$value

Return Value

$this

array __sleep()

Return Value

array

mixed __call($method, $args)

Parameters

$method
$args

Return Value

mixed

Exceptions

Exception

__clone()

array getObjectVars()

returns object values without the dao

Return Value

array

array __debugInfo()

Return Value

array

void beginTransaction()

Return Value

void

void commit()

Return Value

void

void rollBack()

Return Value

void

void configure()

Return Value

void

array getValidTableColumns(string $table, bool $cache)

Parameters

string $table
bool $cache

Return Value

array

void resetValidTableColumnsCache(string $table)

Parameters

string $table

Return Value

void

static Tag|null getById($id)

Parameters

$id

Return Value

Tag|null

static Tag[] getTagsForElement($cType, $cId)

returns all assigned tags for element

Parameters

$cType
$cId

Return Value

Tag[]

static addTagToElement($cType, $cId, Tag $tag)

adds given tag to element

Parameters

$cType
$cId
Tag $tag

static removeTagFromElement($cType, $cId, Tag $tag)

removes given tag from element

Parameters

$cType
$cId
Tag $tag

static setTagsForElement($cType, $cId, array $tags)

sets given tags to element and removes all other tags to remove all tags from element, provide empty array of tags

Parameters

$cType
$cId
array $tags

static batchAssignTagsToElement($cType, array $cIds, array $tagIds, bool|false $replace = false)

Parameters

$cType
array $cIds
array $tagIds
bool|false $replace

static array getElementsForTag(Tag $tag, string $type, array $subtypes = [], array $classNames = [], bool $considerChildTags = false)

Retrieves all elements that have a specific tag or one of its child tags assigned

Parameters

Tag $tag The tag to search for
string $type The type of elements to search for: 'document', 'asset' or 'object'
array $subtypes Filter by subtypes, eg. page, object, email, folder etc.
array $classNames For objects only: filter by classnames
bool $considerChildTags Look for elements having one of $tag's children assigned

Return Value

array

save()

int getId()

Return Value

int

Tag setId(int $id)

Parameters

int $id

Return Value

Tag

string getName()

Return Value

string

Tag setName(string $name)

Parameters

string $name

Return Value

Tag

int getParentId()

Return Value

int

Tag setParentId(int $parentId)

Parameters

int $parentId

Return Value

Tag

Tag getParent()

Return Value

Tag

string getIdPath()

Return Value

string

string getFullIdPath()

Return Value

string

string getNamePath(bool $includeOwnName = true)

Parameters

bool $includeOwnName

Return Value

string

Tag[] getChildren()

Return Value

Tag[]

bool hasChildren()

Return Value

bool

correctPath()