PHP Interface Sulu\Bundle\MediaBundle\Collection\Manager\CollectionManagerInterface

The CollectionManager is responsible for the centralized management of our collections.
显示文件 Open project: sulu/sulu Interface Usage Examples

Public Methods

Method Description
delete ( integer $id ) Deletes a collection with a given id.
get ( integer $locale, array $filter = [], integer $limit = null, integer $offset = null, array $sortBy = [] ) : Doctrine\ORM\Tools\Pagination\Paginator Returns collections with a given parent and/or a given depth-level if no arguments passed returns all collection.
getById ( integer $id, integer $locale, integer $depth, boolean $breadcrumb = false, array $filter = [], array $sortBy = [] ) : Collection Returns a collection with a given id.
getByKey ( string $key, string $locale ) : Collection Returns collection by key.
getCount ( ) : integer Returns a collection count.
getFieldDescriptor ( string $key ) : DoctrineFieldDescriptor Return the FieldDescriptors.
getFieldDescriptors ( ) : DoctrineFieldDescriptor[] Return the FieldDescriptors.
getTree ( string $locale, integer $offset, integer $limit, string $search, integer $depth, array $sortBy = [], boolean $systemCollections = true ) : Collection[] Returns collections from root with given depth.
getTreeById ( integer $id, string $locale ) : Collection[] Returns tree for given id. Including all parents with sliblings and children.
move ( integer $id, string $locale, integer | null $destinationId = null ) : Collection Moves a collection into another collection If you pass parentId = null i moves to the root.
save ( array $data, integer $userId ) : Collection Creates a new collection or overrides an existing one.

Method Details

delete() public method

Deletes a collection with a given id.
public delete ( integer $id )
$id integer the id of the category to delete

get() public method

Returns collections with a given parent and/or a given depth-level if no arguments passed returns all collection.
public get ( integer $locale, array $filter = [], integer $limit = null, integer $offset = null, array $sortBy = [] ) : Doctrine\ORM\Tools\Pagination\Paginator
$locale integer the locale which the collection should be return
$filter array for parent or depth
$limit integer limit the output
$offset integer offset the output
$sortBy array sort by e.g. array('title' => 'ASC')
return Doctrine\ORM\Tools\Pagination\Paginator

getById() public method

Returns a collection with a given id.
public getById ( integer $id, integer $locale, integer $depth, boolean $breadcrumb = false, array $filter = [], array $sortBy = [] ) : Collection
$id integer the id of the collection
$locale integer the locale which the collection should be return
$depth integer if depth > 1 children will returned also
$breadcrumb boolean if true breadcrumb will be appended
$filter array array of criteria
$sortBy array fields to sort by
return Sulu\Bundle\MediaBundle\Api\Collection

getByKey() public method

Returns collection by key.
public getByKey ( string $key, string $locale ) : Collection
$key string
$locale string
return Sulu\Bundle\MediaBundle\Api\Collection

getCount() public method

Returns a collection count.
public getCount ( ) : integer
return integer

getFieldDescriptor() public method

Return the FieldDescriptors.
public getFieldDescriptor ( string $key ) : DoctrineFieldDescriptor
$key string
return Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptor

getFieldDescriptors() public method

Return the FieldDescriptors.
public getFieldDescriptors ( ) : DoctrineFieldDescriptor[]
return Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptor[]

getTree() public method

Returns collections from root with given depth.
public getTree ( string $locale, integer $offset, integer $limit, string $search, integer $depth, array $sortBy = [], boolean $systemCollections = true ) : Collection[]
$locale string the locale which the collection should be return
$offset integer
$limit integer
$search string
$depth integer maximum depth for query
$sortBy array
$systemCollections boolean Whether or not system collectino should be included in the result
return Sulu\Bundle\MediaBundle\Api\Collection[]

getTreeById() public method

Returns tree for given id. Including all parents with sliblings and children.
public getTreeById ( integer $id, string $locale ) : Collection[]
$id integer
$locale string
return Sulu\Bundle\MediaBundle\Api\Collection[]

move() public method

Moves a collection into another collection If you pass parentId = null i moves to the root.
public move ( integer $id, string $locale, integer | null $destinationId = null ) : Collection
$id integer the id of the category to move
$locale string the locale which the collection should be return
$destinationId integer | null the parent where the collection should be placed
return Sulu\Bundle\MediaBundle\Api\Collection

save() public method

Creates a new collection or overrides an existing one.
public save ( array $data, integer $userId ) : Collection
$data array The data of the category to save
$userId integer The id of the user, who is doing this change
return Sulu\Bundle\MediaBundle\Api\Collection