PHP Class Sulu\Bundle\MediaBundle\Collection\Manager\CollectionManager

Inheritance: implements Sulu\Bundle\MediaBundle\Collection\Manager\CollectionManagerInterface
Exibir arquivo Open project: sulu/sulu Class Usage Examples

Protected Properties

Property Type Description
$em Doctrine\ORM\EntityManager

Public Methods

Method Description
__construct ( Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface $collectionRepository, Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface $mediaRepository, Sulu\Bundle\MediaBundle\Media\FormatManager\FormatManagerInterface $formatManager, Sulu\Component\Security\Authentication\UserRepositoryInterface $userRepository, EntityManager $em, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage = null, $collectionPreviewFormat, $permissions )
delete ( $id )
get ( $locale, $filter = [], $limit = null, $offset = null, $sortBy = [] )
getById ( $id, $locale, $depth, $breadcrumb = false, $filter = [], $sortBy = [] )
getByKey ( $key, $locale )
getCount ( ) : integer
getFieldDescriptor ( $key )
getFieldDescriptors ( )
getTree ( $locale, $offset, $limit, $search, $depth, $sortBy = [], $systemCollections = true )
getTreeById ( $id, $locale )
move ( $id, $locale, $destinationId = null )
save ( $data, $userId )

Protected Methods

Method Description
addPreview ( Collection $collection ) : Collection
getApiEntity ( Sulu\Bundle\MediaBundle\Entity\CollectionInterface $entity, string $locale, Collection[] $entities = null, array $breadcrumbEntities = null ) : Collection Prepare an api entity.
getCurrentUser ( ) : Sulu\Component\Security\Authentication\UserInterface | null Returns the current user from the token storage.
getPreview ( integer $id, string $locale ) : array
getPreviewsFromFileVersion ( integer $mediaId, FileVersion $fileVersion, string $locale ) : array
getTypeById ( $typeId ) : CollectionType
getUser ( $userId ) : Sulu\Component\Security\Authentication\UserInterface Returns a user for a given user-id.
setDataToCollection ( Collection $collection, array $data ) : Collection Data can be set over by array.

Private Methods

Method Description
createCollection ( $data, $user ) : Collection
initializeFieldDescriptors ( ) : DoctrineFieldDescriptor[]
modifyCollection ( $data, $user ) : Collection Modified an exists collection.

Method Details

__construct() public method

public __construct ( Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface $collectionRepository, Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface $mediaRepository, Sulu\Bundle\MediaBundle\Media\FormatManager\FormatManagerInterface $formatManager, Sulu\Component\Security\Authentication\UserRepositoryInterface $userRepository, EntityManager $em, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage = null, $collectionPreviewFormat, $permissions )
$collectionRepository Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface
$mediaRepository Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface
$formatManager Sulu\Bundle\MediaBundle\Media\FormatManager\FormatManagerInterface
$userRepository Sulu\Component\Security\Authentication\UserRepositoryInterface
$em Doctrine\ORM\EntityManager
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface

addPreview() protected method

protected addPreview ( Collection $collection ) : Collection
$collection Sulu\Bundle\MediaBundle\Api\Collection
return Sulu\Bundle\MediaBundle\Api\Collection

delete() public method

public delete ( $id )

get() public method

public get ( $locale, $filter = [], $limit = null, $offset = null, $sortBy = [] )

getApiEntity() protected method

Prepare an api entity.
protected getApiEntity ( Sulu\Bundle\MediaBundle\Entity\CollectionInterface $entity, string $locale, Collection[] $entities = null, array $breadcrumbEntities = null ) : Collection
$entity Sulu\Bundle\MediaBundle\Entity\CollectionInterface
$locale string
$entities Sulu\Bundle\MediaBundle\Entity\Collection[] nested set
$breadcrumbEntities array
return Sulu\Bundle\MediaBundle\Api\Collection

getById() public method

public getById ( $id, $locale, $depth, $breadcrumb = false, $filter = [], $sortBy = [] )

getByKey() public method

public getByKey ( $key, $locale )

getCount() public method

public getCount ( ) : integer
return integer

getCurrentUser() protected method

Returns the current user from the token storage.
protected getCurrentUser ( ) : Sulu\Component\Security\Authentication\UserInterface | null
return Sulu\Component\Security\Authentication\UserInterface | null

getFieldDescriptor() public method

public getFieldDescriptor ( $key )

getFieldDescriptors() public method

public getFieldDescriptors ( )

getPreview() protected method

protected getPreview ( integer $id, string $locale ) : array
$id integer
$locale string
return array

getPreviewsFromFileVersion() protected method

protected getPreviewsFromFileVersion ( integer $mediaId, FileVersion $fileVersion, string $locale ) : array
$mediaId integer
$fileVersion Sulu\Bundle\MediaBundle\Entity\FileVersion
$locale string
return array

getTree() public method

public getTree ( $locale, $offset, $limit, $search, $depth, $sortBy = [], $systemCollections = true )

getTreeById() public method

public getTreeById ( $id, $locale )

getTypeById() protected method

protected getTypeById ( $typeId ) : CollectionType
$typeId
return Sulu\Bundle\MediaBundle\Entity\CollectionType

getUser() protected method

Returns a user for a given user-id.
protected getUser ( $userId ) : Sulu\Component\Security\Authentication\UserInterface
$userId
return Sulu\Component\Security\Authentication\UserInterface

move() public method

public move ( $id, $locale, $destinationId = null )

save() public method

public save ( $data, $userId )

setDataToCollection() protected method

Data can be set over by array.
protected setDataToCollection ( Collection $collection, array $data ) : Collection
$collection Sulu\Bundle\MediaBundle\Api\Collection
$data array
return Sulu\Bundle\MediaBundle\Api\Collection

Property Details

$em protected_oe property

protected EntityManager,Doctrine\ORM $em
return Doctrine\ORM\EntityManager