PHP Interface Sulu\Bundle\TagBundle\Tag\TagManagerInterface

The TagManager is responsible for the centralized management of our tags.
Mostrar archivo Open project: sulu/sulu Interface Usage Examples

Public Methods

Method Description
delete ( number $id ) Deletes the given Tag.
findAll ( ) : Tag[] Loads all the tags managed in this system.
findById ( $id ) : Tag Loads the tag with the given id.
findByName ( $name ) : Tag Loads the tag with the given name.
findOrCreateByName ( string $name, integer $userId ) : Tag Loads the tag with the given name, or creates it, if it does not exist.
getFieldDescriptor ( string $key ) : Sulu\Component\Rest\ListBuilder\FieldDescriptor\DoctrineFieldDescriptor Returns the FieldDescriptor for the given key.
getFieldDescriptors ( ) : Sulu\Component\Rest\ListBuilder\FieldDescriptor\DoctrineFieldDescriptor[] Returns the FieldDescriptors for the products.
merge ( array $srcTagIds, number $destTagId ) : Tag Merges the source tag into the destination tag.
resolveTagIds ( $tagIds ) : array Resolves tag ids to names.
resolveTagNames ( $tagNames ) : array Resolves tag names to ids.
save ( array $data, integer $userId, number | null $id = null ) Saves the given Tag.

Method Details

delete() public method

Deletes the given Tag.
public delete ( number $id )
$id number The tag to delete

findAll() public method

Loads all the tags managed in this system.
public findAll ( ) : Tag[]
return Sulu\Bundle\TagBundle\Entity\Tag[]

findById() public method

Loads the tag with the given id.
public findById ( $id ) : Tag
$id number The id of the tag
return Sulu\Bundle\TagBundle\Entity\Tag

findByName() public method

Loads the tag with the given name.
public findByName ( $name ) : Tag
$name
return Sulu\Bundle\TagBundle\Entity\Tag

findOrCreateByName() public method

Loads the tag with the given name, or creates it, if it does not exist.
public findOrCreateByName ( string $name, integer $userId ) : Tag
$name string The name to find or create
$userId integer The id of the user who tries to find a tag
return Sulu\Bundle\TagBundle\Entity\Tag

getFieldDescriptor() public method

Returns the FieldDescriptor for the given key.
public getFieldDescriptor ( string $key ) : Sulu\Component\Rest\ListBuilder\FieldDescriptor\DoctrineFieldDescriptor
$key string The key of the FieldDescriptor to return
return Sulu\Component\Rest\ListBuilder\FieldDescriptor\DoctrineFieldDescriptor

getFieldDescriptors() public method

Returns the FieldDescriptors for the products.
public getFieldDescriptors ( ) : Sulu\Component\Rest\ListBuilder\FieldDescriptor\DoctrineFieldDescriptor[]
return Sulu\Component\Rest\ListBuilder\FieldDescriptor\DoctrineFieldDescriptor[]

merge() public method

The source tag will be deleted.
public merge ( array $srcTagIds, number $destTagId ) : Tag
$srcTagIds array The source tags, which will be removed afterwards
$destTagId number The destination tag, which will replace the source tag
return Sulu\Bundle\TagBundle\Entity\Tag The new Tag, which is valid for both given tags

resolveTagIds() public method

Resolves tag ids to names.
public resolveTagIds ( $tagIds ) : array
$tagIds
return array

resolveTagNames() public method

Resolves tag names to ids.
public resolveTagNames ( $tagNames ) : array
$tagNames
return array

save() public method

Saves the given Tag.
public save ( array $data, integer $userId, number | null $id = null )
$data array The data of the tag to save
$userId integer The id of the user, who is doing this change
$id number | null The id for saving the tag (optional)