PHP Интерфейс Sulu\Bundle\TagBundle\Tag\TagManagerInterface

The TagManager is responsible for the centralized management of our tags.
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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.

Описание методов

delete() публичный Метод

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

findAll() публичный Метод

Loads all the tags managed in this system.
public findAll ( ) : Tag[]
Результат Sulu\Bundle\TagBundle\Entity\Tag[]

findById() публичный Метод

Loads the tag with the given id.
public findById ( $id ) : Tag
$id number The id of the tag
Результат Sulu\Bundle\TagBundle\Entity\Tag

findByName() публичный Метод

Loads the tag with the given name.
public findByName ( $name ) : Tag
$name
Результат Sulu\Bundle\TagBundle\Entity\Tag

findOrCreateByName() публичный Метод

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
Результат Sulu\Bundle\TagBundle\Entity\Tag

getFieldDescriptor() публичный Метод

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
Результат Sulu\Component\Rest\ListBuilder\FieldDescriptor\DoctrineFieldDescriptor

getFieldDescriptors() публичный Метод

Returns the FieldDescriptors for the products.
public getFieldDescriptors ( ) : Sulu\Component\Rest\ListBuilder\FieldDescriptor\DoctrineFieldDescriptor[]
Результат Sulu\Component\Rest\ListBuilder\FieldDescriptor\DoctrineFieldDescriptor[]

merge() публичный Метод

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
Результат Sulu\Bundle\TagBundle\Entity\Tag The new Tag, which is valid for both given tags

resolveTagIds() публичный Метод

Resolves tag ids to names.
public resolveTagIds ( $tagIds ) : array
$tagIds
Результат array

resolveTagNames() публичный Метод

Resolves tag names to ids.
public resolveTagNames ( $tagNames ) : array
$tagNames
Результат array

save() публичный Метод

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)