PHP Class Pimcore\Model\Element\Tag

Inheritance: extends Pimcore\Model\AbstractModel
Afficher le fichier Open project: pimcore/pimcore Class Usage Examples

Méthodes publiques

Свойство Type Description
$children Tag[]
$id integer
$idPath string
$name string
$parent Tag
$parentId integer

Méthodes publiques

Méthode Description
addTagToElement ( $cType, $cId, Tag $tag ) adds given tag to element
batchAssignTagsToElement ( $cType, array $cIds, array $tagIds, boolean | false $replace = false )
correctPath ( )
getById ( $id ) : Pimcore\Model\Element\Tag
getChildren ( ) : Tag[]
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
getFullIdPath ( ) : string
getId ( ) : integer
getIdPath ( ) : string
getName ( ) : string
getNamePath ( $includeOwnName = true )
getParent ( ) : Tag
getParentId ( ) : integer
getTagsForElement ( $cType, $cId ) : Tag[] returns all assigned tags for element
hasChildren ( )
removeTagFromElement ( $cType, $cId, Tag $tag ) removes given tag from element
save ( )
setId ( integer $id ) : Tag
setName ( string $name ) : Tag
setParentId ( integer $parentId ) : Tag
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

Method Details

addTagToElement() public static méthode

adds given tag to element
public static addTagToElement ( $cType, $cId, Tag $tag )
$cType
$cId
$tag Tag

batchAssignTagsToElement() public static méthode

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

correctPath() public méthode

public correctPath ( )

getById() public static méthode

public static getById ( $id ) : Pimcore\Model\Element\Tag
$id
Résultat Pimcore\Model\Element\Tag

getChildren() public méthode

public getChildren ( ) : Tag[]
Résultat Tag[]

getElementsForTag() public static méthode

Retrieves all elements that have a specific tag or one of its child tags assigned
public static getElementsForTag ( Tag $tag, string $type, array $subtypes = [], array $classNames = [], boolean $considerChildTags = false ) : array
$tag 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
Résultat array

getFullIdPath() public méthode

public getFullIdPath ( ) : string
Résultat string

getId() public méthode

public getId ( ) : integer
Résultat integer

getIdPath() public méthode

public getIdPath ( ) : string
Résultat string

getName() public méthode

public getName ( ) : string
Résultat string

getNamePath() public méthode

public getNamePath ( $includeOwnName = true )

getParent() public méthode

public getParent ( ) : Tag
Résultat Tag

getParentId() public méthode

public getParentId ( ) : integer
Résultat integer

getTagsForElement() public static méthode

returns all assigned tags for element
public static getTagsForElement ( $cType, $cId ) : Tag[]
$cType
$cId
Résultat Tag[]

hasChildren() public méthode

public hasChildren ( )

removeTagFromElement() public static méthode

removes given tag from element
public static removeTagFromElement ( $cType, $cId, Tag $tag )
$cType
$cId
$tag Tag

save() public méthode

public save ( )

setId() public méthode

public setId ( integer $id ) : Tag
$id integer
Résultat Tag

setName() public méthode

public setName ( string $name ) : Tag
$name string
Résultat Tag

setParentId() public méthode

public setParentId ( integer $parentId ) : Tag
$parentId integer
Résultat Tag

setTagsForElement() public static méthode

sets given tags to element and removes all other tags to remove all tags from element, provide empty array of tags
public static setTagsForElement ( $cType, $cId, array $tags )
$cType
$cId
$tags array

Property Details

$children public_oe property

public Tag[],Pimcore\Model\Element $children
Résultat Tag[]

$id public_oe property

public int $id
Résultat integer

$idPath public_oe property

public string $idPath
Résultat string

$name public_oe property

public string $name
Résultat string

$parent public_oe property

public Tag,Pimcore\Model\Element $parent
Résultat Tag

$parentId public_oe property

public int $parentId
Résultat integer