PHP Class Pimcore\Model\Element\Tag\Dao

Inheritance: extends Pimcore\Model\Dao\AbstractDao
Show file Open project: pimcore/pimcore

Public Methods

Method Description
addTagToElement ( $cType, $cId )
batchAssignTagsToElement ( $cType, array $cIds, array $tagIds, $replace )
delete ( ) : void Deletes object from database
getById ( $id )
getElementsForTag ( Tag $tag, string $type, array $subtypes = [], array $classNames = [], boolean $considerChildTags = false ) : array Retrieves all elements that have a specific tag or one of its child tags assigned
getTagsForElement ( $cType, $cId ) : Tag[]
removeTagFromElement ( $cType, $cId )
save ( ) : void Save object to database
setTagsForElement ( $cType, $cId, array $tags )

Protected Methods

Method Description
doAddTagToElement ( $tagId, $cType, $cId )

Method Details

addTagToElement() public method

public addTagToElement ( $cType, $cId )
$cType
$cId

batchAssignTagsToElement() public method

public batchAssignTagsToElement ( $cType, array $cIds, array $tagIds, $replace )
$cIds array
$tagIds array

delete() public method

Deletes object from database
public delete ( ) : void
return void

doAddTagToElement() protected method

protected doAddTagToElement ( $tagId, $cType, $cId )

getById() public method

public getById ( $id )
$id

getElementsForTag() public method

Retrieves all elements that have a specific tag or one of its child tags assigned
public getElementsForTag ( Tag $tag, string $type, array $subtypes = [], array $classNames = [], boolean $considerChildTags = false ) : array
$tag Pimcore\Model\Element\Tag The tag to search for
$type string The type of elements to search for: 'document', 'asset' or 'object'
$subtypes array Filter by subtypes, eg. page, object, email, folder etc.
$classNames array For objects only: filter by classnames
$considerChildTags boolean Look for elements having one of $tag's children assigned
return array

getTagsForElement() public method

public getTagsForElement ( $cType, $cId ) : Tag[]
$cType
$cId
return Pimcore\Model\Element\Tag[]

removeTagFromElement() public method

public removeTagFromElement ( $cType, $cId )

save() public method

Save object to database
public save ( ) : void
return void

setTagsForElement() public method

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