PHP 인터페이스 Sulu\Bundle\CategoryBundle\Category\CategoryManagerInterface

The CategoryManager is responsible for the centralized management of our categories.
파일 보기 프로젝트 열기: sulu/sulu 0 사용 예제들

공개 메소드들

메소드 설명
delete ( integer $id ) Deletes the category which is assigned to the given id.
find ( integer $parent = null, integer $depth = null, string | null $sortBy = null, string | null $sortOrder = null ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[] Returns tags with a given parent and/or a given depth-level if no arguments passed returns all categories.
findById ( integer $id ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface Returns the category which is assigned to the given id.
findByIds ( array $ids ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[] Returns an array of categories which are assigned to the given array of ids.
findByKey ( string $key ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface Returns the category which is assigned to the given key.
findChildren ( integer $key, string | null $sortBy = null, string | null $sortOrder = null ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[] Returns the children for a given category.
findChildrenByParentId ( null $parentId = null ) : array Returns the whole category graph.
findChildrenByParentKey ( null $parentKey = null ) : array Returns the whole category graph.
getApiObject ( Sulu\Bundle\CategoryBundle\Entity\CategoryInterface $category, string $locale ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface Returns an API-Object for a given category-entity. The API-Object wraps the entity and provides neat getters and setters.
getApiObjects ( Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[] $categories, string $locale ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface Same as getApiObject, but takes multiple category-entities.
getFieldDescriptor ( string $locale, string $key ) : DoctrineFieldDescriptor Returns the FieldDescriptor for the given key.
getFieldDescriptors ( string $locale ) : DoctrineFieldDescriptor[] Returns the FieldDescriptors for the categories.
save ( $data, $userId, $locale, boolean $patch = false ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface Creates or updates the given data as category in the given locale and return the saved category.

메소드 상세

delete() 공개 메소드

Deletes the category which is assigned to the given id.
public delete ( integer $id )
$id integer

find() 공개 메소드

Returns tags with a given parent and/or a given depth-level if no arguments passed returns all categories.
사용 중단: Use ::findChildrenByParentId instead
public find ( integer $parent = null, integer $depth = null, string | null $sortBy = null, string | null $sortOrder = null ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]
$parent integer the id of the parent to filter for
$depth integer the depth-level to filter for
$sortBy string | null column name to sort the categories by
$sortOrder string | null sort order
리턴 Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]

findById() 공개 메소드

Returns the category which is assigned to the given id.
public findById ( integer $id ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
$id integer
리턴 Sulu\Bundle\CategoryBundle\Entity\CategoryInterface

findByIds() 공개 메소드

If an id of the array is not assigned to a category, no error is thrown.
public findByIds ( array $ids ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]
$ids array
리턴 Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]

findByKey() 공개 메소드

Returns the category which is assigned to the given key.
public findByKey ( string $key ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
$key string
리턴 Sulu\Bundle\CategoryBundle\Entity\CategoryInterface

findChildren() 공개 메소드

Returns the children for a given category.
사용 중단: Use ::findChildrenByParentKey instead
public findChildren ( integer $key, string | null $sortBy = null, string | null $sortOrder = null ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]
$key integer the key of the category to search the children for
$sortBy string | null column name to sort by
$sortOrder string | null sort order
리턴 Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]

findChildrenByParentId() 공개 메소드

If parentId is set, only the sub-graph below the category which is assigned to the given id is returned.
public findChildrenByParentId ( null $parentId = null ) : array
$parentId null
리턴 array

findChildrenByParentKey() 공개 메소드

If parentKey is set, only the sub-graph below the category which is assigned to the given key is returned.
public findChildrenByParentKey ( null $parentKey = null ) : array
$parentKey null
리턴 array

getApiObject() 공개 메소드

Returns an API-Object for a given category-entity. The API-Object wraps the entity and provides neat getters and setters.
public getApiObject ( Sulu\Bundle\CategoryBundle\Entity\CategoryInterface $category, string $locale ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
$category Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
$locale string
리턴 Sulu\Bundle\CategoryBundle\Entity\CategoryInterface

getApiObjects() 공개 메소드

Same as getApiObject, but takes multiple category-entities.
public getApiObjects ( Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[] $categories, string $locale ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
$categories Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]
$locale string
리턴 Sulu\Bundle\CategoryBundle\Entity\CategoryInterface

getFieldDescriptor() 공개 메소드

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

getFieldDescriptors() 공개 메소드

Returns the FieldDescriptors for the categories.
public getFieldDescriptors ( string $locale ) : DoctrineFieldDescriptor[]
$locale string
리턴 Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptor[]

save() 공개 메소드

If data.id is set, the category which is assigned to the given id is overwritten. If patch is set, the category which is assigned to the given id is updated partially.
public save ( $data, $userId, $locale, boolean $patch = false ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
$data
$userId int Id of the user which is set as creator/changer. If null, the user of the request is set
$locale
$patch boolean
리턴 Sulu\Bundle\CategoryBundle\Entity\CategoryInterface