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

Inheritance: implements Sulu\Bundle\MediaBundle\Collection\Manager\CollectionManagerInterface
Afficher le fichier Open project: sulu/sulu Class Usage Examples

Protected Properties

Свойство Type Description
$em Doctrine\ORM\EntityManager

Méthodes publiques

Méthode 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 )

Méthodes protégées

Méthode 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

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

Method Details

__construct() public méthode

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 méthode

protected addPreview ( Collection $collection ) : Collection
$collection Sulu\Bundle\MediaBundle\Api\Collection
Résultat Sulu\Bundle\MediaBundle\Api\Collection

delete() public méthode

public delete ( $id )

get() public méthode

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

getApiEntity() protected méthode

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
Résultat Sulu\Bundle\MediaBundle\Api\Collection

getById() public méthode

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

getByKey() public méthode

public getByKey ( $key, $locale )

getCount() public méthode

public getCount ( ) : integer
Résultat integer

getCurrentUser() protected méthode

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

getFieldDescriptor() public méthode

public getFieldDescriptor ( $key )

getFieldDescriptors() public méthode

public getFieldDescriptors ( )

getPreview() protected méthode

protected getPreview ( integer $id, string $locale ) : array
$id integer
$locale string
Résultat array

getPreviewsFromFileVersion() protected méthode

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

getTree() public méthode

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

getTreeById() public méthode

public getTreeById ( $id, $locale )

getTypeById() protected méthode

protected getTypeById ( $typeId ) : CollectionType
$typeId
Résultat Sulu\Bundle\MediaBundle\Entity\CollectionType

getUser() protected méthode

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

move() public méthode

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

save() public méthode

public save ( $data, $userId )

setDataToCollection() protected méthode

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

Property Details

$em protected_oe property

protected EntityManager,Doctrine\ORM $em
Résultat Doctrine\ORM\EntityManager