class Tag extends AbstractModel (View source)

Properties

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

$this
setValues(array $data = array())

No description

$this
setValue($key, $value)

No description

array
__sleep()

No description

mixed
__call($method, $args)

No description

void
__clone()

No description

array
getObjectVars()

returns object values without the dao

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(), array $classNames = array(), 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

getNamePath($includeOwnName = true)

No description

Tag[]
getChildren()

No description

hasChildren()

No description

correctPath()

No description

Details

at line line 24
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

$this setValues(array $data = array())

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

void __clone()

Return Value

void

array getObjectVars()

returns object values without the dao

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

at line line 63
static Tag|null getById($id)

Parameters

$id

Return Value

Tag|null

at line line 82
static Tag[] getTagsForElement($cType, $cId)

returns all assigned tags for element

Parameters

$cType
$cId

Return Value

Tag[]

at line line 96
static addTagToElement($cType, $cId, Tag $tag)

adds given tag to element

Parameters

$cType
$cId
Tag $tag

at line line 108
static removeTagFromElement($cType, $cId, Tag $tag)

removes given tag from element

Parameters

$cType
$cId
Tag $tag

at line line 121
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

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

Parameters

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

at line line 150
static array getElementsForTag(Tag $tag, string $type, array $subtypes = array(), array $classNames = array(), 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

at line line 156
save()

at line line 165
int getId()

Return Value

int

at line line 174
Tag setId(int $id)

Parameters

int $id

Return Value

Tag

at line line 184
string getName()

Return Value

string

at line line 193
Tag setName(string $name)

Parameters

string $name

Return Value

Tag

at line line 203
int getParentId()

Return Value

int

at line line 212
Tag setParentId(int $parentId)

Parameters

int $parentId

Return Value

Tag

at line line 224
Tag getParent()

Return Value

Tag

at line line 236
string getIdPath()

Return Value

string

at line line 244
string getFullIdPath()

Return Value

string

at line line 249
getNamePath($includeOwnName = true)

Parameters

$includeOwnName

at line line 270
Tag[] getChildren()

Return Value

Tag[]

at line line 282
hasChildren()

at line line 288
correctPath()