PHP 클래스 Sulu\Bundle\MediaBundle\Media\Manager\MediaManager

상속: implements Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface
파일 보기 프로젝트 열기: sulu/sulu 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$count integer

보호된 프로퍼티들

프로퍼티 타입 설명
$categoryRepository Sulu\Bundle\CategoryBundle\Entity\CategoryRepositoryInterface
$collectionRepository Sulu\Bundle\MediaBundle\Entity\CollectionRepository The repository for communication with the database.
$mediaRepository Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface The repository for communication with the database.
$storage Sulu\Bundle\MediaBundle\Media\Storage\StorageInterface
$typeManager Sulu\Bundle\MediaBundle\Media\TypeManager\TypeManagerInterface

공개 메소드들

메소드 설명
__construct ( Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface $mediaRepository, Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface $collectionRepository, Sulu\Component\Security\Authentication\UserRepositoryInterface $userRepository, Sulu\Bundle\CategoryBundle\Entity\CategoryRepositoryInterface $categoryRepository, EntityManager $em, Sulu\Bundle\MediaBundle\Media\Storage\StorageInterface $storage, Sulu\Bundle\MediaBundle\Media\FileValidator\FileValidatorInterface $validator, Sulu\Bundle\MediaBundle\Media\FormatManager\FormatManagerInterface $formatManager, Sulu\Bundle\TagBundle\Tag\TagManagerInterface $tagManager, Sulu\Bundle\MediaBundle\Media\TypeManager\TypeManagerInterface $typeManager, Sulu\Component\PHPCR\PathCleanupInterface $pathCleaner, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage = null, Sulu\Component\Security\Authorization\SecurityCheckerInterface $securityChecker = null, FFMpeg\FFProbe $ffprobe, array $permissions, string $downloadPath, string $maxFileSize )
addFormatsAndUrl ( Media $media ) : Media
delete ( $id, $checkSecurity = false )
get ( $locale, $filter = [], $limit = null, $offset = null )
getById ( $id, $locale )
getByIds ( array $ids, $locale )
getCollectionById ( $collectionId ) : object
getCount ( )
getEntityById ( $id )
getFormatUrls ( $ids, $locale )
getUrl ( $id, $fileName, $version )
increaseDownloadCounter ( $fileVersionId )
move ( $id, $locale, $destCollection )
save ( $uploadedFile, $data, $userId )

보호된 메소드들

메소드 설명
createMedia ( $data, $user ) : Media Create a new media.
getCurrentUser ( ) : Sulu\Component\Security\Authentication\UserInterface | void Returns current user or null if no user is loggedin.
getUser ( $userId ) : Sulu\Component\Security\Authentication\UserInterface Returns a user for a given user-id.
setDataToMedia ( Media $media, $data, Sulu\Component\Security\Authentication\UserInterface $user ) : Media Data can be set over by array.

비공개 메소드들

메소드 설명
buildData ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, array $data, Sulu\Component\Security\Authentication\UserInterface $user ) : Media Prepares data.
getNormalizedFileName ( $originalFileName ) : string Returns file name without special characters and preserves file extension.
getProperties ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile ) : array
modifyMedia ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, $data, Sulu\Component\Security\Authentication\UserInterface $user ) : Media Modifies an existing media.

메소드 상세

__construct() 공개 메소드

public __construct ( Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface $mediaRepository, Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface $collectionRepository, Sulu\Component\Security\Authentication\UserRepositoryInterface $userRepository, Sulu\Bundle\CategoryBundle\Entity\CategoryRepositoryInterface $categoryRepository, EntityManager $em, Sulu\Bundle\MediaBundle\Media\Storage\StorageInterface $storage, Sulu\Bundle\MediaBundle\Media\FileValidator\FileValidatorInterface $validator, Sulu\Bundle\MediaBundle\Media\FormatManager\FormatManagerInterface $formatManager, Sulu\Bundle\TagBundle\Tag\TagManagerInterface $tagManager, Sulu\Bundle\MediaBundle\Media\TypeManager\TypeManagerInterface $typeManager, Sulu\Component\PHPCR\PathCleanupInterface $pathCleaner, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage = null, Sulu\Component\Security\Authorization\SecurityCheckerInterface $securityChecker = null, FFMpeg\FFProbe $ffprobe, array $permissions, string $downloadPath, string $maxFileSize )
$mediaRepository Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface
$collectionRepository Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface
$userRepository Sulu\Component\Security\Authentication\UserRepositoryInterface
$categoryRepository Sulu\Bundle\CategoryBundle\Entity\CategoryRepositoryInterface
$em Doctrine\ORM\EntityManager
$storage Sulu\Bundle\MediaBundle\Media\Storage\StorageInterface
$validator Sulu\Bundle\MediaBundle\Media\FileValidator\FileValidatorInterface
$formatManager Sulu\Bundle\MediaBundle\Media\FormatManager\FormatManagerInterface
$tagManager Sulu\Bundle\TagBundle\Tag\TagManagerInterface
$typeManager Sulu\Bundle\MediaBundle\Media\TypeManager\TypeManagerInterface
$pathCleaner Sulu\Component\PHPCR\PathCleanupInterface
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
$securityChecker Sulu\Component\Security\Authorization\SecurityCheckerInterface
$ffprobe FFMpeg\FFProbe
$permissions array
$downloadPath string
$maxFileSize string

addFormatsAndUrl() 공개 메소드

public addFormatsAndUrl ( Media $media ) : Media
$media Sulu\Bundle\MediaBundle\Api\Media
리턴 Sulu\Bundle\MediaBundle\Api\Media

createMedia() 보호된 메소드

Create a new media.
protected createMedia ( $data, $user ) : Media
$data
$user
리턴 Sulu\Bundle\MediaBundle\Api\Media

delete() 공개 메소드

public delete ( $id, $checkSecurity = false )

get() 공개 메소드

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

getById() 공개 메소드

public getById ( $id, $locale )

getByIds() 공개 메소드

public getByIds ( array $ids, $locale )
$ids array

getCollectionById() 공개 메소드

public getCollectionById ( $collectionId ) : object
$collectionId
리턴 object

getCount() 공개 메소드

public getCount ( )

getCurrentUser() 보호된 메소드

Returns current user or null if no user is loggedin.
protected getCurrentUser ( ) : Sulu\Component\Security\Authentication\UserInterface | void
리턴 Sulu\Component\Security\Authentication\UserInterface | void

getEntityById() 공개 메소드

public getEntityById ( $id )

getFormatUrls() 공개 메소드

public getFormatUrls ( $ids, $locale )

getUrl() 공개 메소드

public getUrl ( $id, $fileName, $version )

getUser() 보호된 메소드

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

increaseDownloadCounter() 공개 메소드

public increaseDownloadCounter ( $fileVersionId )

move() 공개 메소드

public move ( $id, $locale, $destCollection )

save() 공개 메소드

public save ( $uploadedFile, $data, $userId )

setDataToMedia() 보호된 메소드

Data can be set over by array.
protected setDataToMedia ( Media $media, $data, Sulu\Component\Security\Authentication\UserInterface $user ) : Media
$media Sulu\Bundle\MediaBundle\Api\Media
$data
$user Sulu\Component\Security\Authentication\UserInterface
리턴 Sulu\Bundle\MediaBundle\Api\Media

프로퍼티 상세

$categoryRepository 보호되어 있는 프로퍼티

protected CategoryRepositoryInterface,Sulu\Bundle\CategoryBundle\Entity $categoryRepository
리턴 Sulu\Bundle\CategoryBundle\Entity\CategoryRepositoryInterface

$collectionRepository 보호되어 있는 프로퍼티

The repository for communication with the database.
protected CollectionRepository,Sulu\Bundle\MediaBundle\Entity $collectionRepository
리턴 Sulu\Bundle\MediaBundle\Entity\CollectionRepository

$count 공개적으로 프로퍼티

public int $count
리턴 integer

$mediaRepository 보호되어 있는 프로퍼티

The repository for communication with the database.
protected MediaRepositoryInterface,Sulu\Bundle\MediaBundle\Entity $mediaRepository
리턴 Sulu\Bundle\MediaBundle\Entity\MediaRepositoryInterface

$storage 보호되어 있는 프로퍼티

protected StorageInterface,Sulu\Bundle\MediaBundle\Media\Storage $storage
리턴 Sulu\Bundle\MediaBundle\Media\Storage\StorageInterface

$typeManager 보호되어 있는 프로퍼티

protected TypeManagerInterface,Sulu\Bundle\MediaBundle\Media\TypeManager $typeManager
리턴 Sulu\Bundle\MediaBundle\Media\TypeManager\TypeManagerInterface