PHP Interface Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface

Show file Open project: sulu/sulu Interface Usage Examples

Public Methods

Method Description
addFormatsAndUrl ( Media $media ) : Media Adds thumbnails and image urls.
delete ( integer $id, $checkSecurity = false ) Deletes a media with a given id.
get ( string $locale, array $filter = [], integer $limit = null, integer $offset = null ) : Media[] Returns media with a given collection and/or ids and/or limit if no arguments passed returns all media.
getById ( integer $id, string $locale ) : Media Returns a media with a given id.
getByIds ( array $ids, string $locale ) : Media[] Returns the medias with the given ids in the specified order.
getCount ( ) : integer Return the count of the last get.
getEntityById ( integer $id ) : Sulu\Bundle\MediaBundle\Entity\MediaInterface Returns a media entity with a given id.
getFormatUrls ( array $ids, string $locale ) : array Takes an array of media ids and returns an array of formats and urls.
getUrl ( string $id, string $fileName, string $version ) : string Returns download url for given id and filename.
increaseDownloadCounter ( integer $fileVersionId ) : mixed Increase the download counter of a fileVersion.
move ( integer $id, string $locale, integer $destCollection ) : Media Moves a media to a given collection.
save ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, array $data, integer $userId ) : Media Creates a new media or overrides an existing one.

Method Details

addFormatsAndUrl() public method

Adds thumbnails and image urls.
public addFormatsAndUrl ( Media $media ) : Media
$media Sulu\Bundle\MediaBundle\Api\Media
return Sulu\Bundle\MediaBundle\Api\Media

delete() public method

Deletes a media with a given id.
public delete ( integer $id, $checkSecurity = false )
$id integer the id of the category to delete

get() public method

Returns media with a given collection and/or ids and/or limit if no arguments passed returns all media.
public get ( string $locale, array $filter = [], integer $limit = null, integer $offset = null ) : Media[]
$locale string the locale which the object will be returned
$filter array collection, ids, types
$limit integer to limit the output
$offset integer to offset the output
return Sulu\Bundle\MediaBundle\Api\Media[]

getById() public method

Returns a media with a given id.
public getById ( integer $id, string $locale ) : Media
$id integer the id of the category
$locale string the locale which the object will be returned
return Sulu\Bundle\MediaBundle\Api\Media

getByIds() public method

Returns the medias with the given ids in the specified order.
public getByIds ( array $ids, string $locale ) : Media[]
$ids array
$locale string
return Sulu\Bundle\MediaBundle\Api\Media[]

getCount() public method

Return the count of the last get.
public getCount ( ) : integer
return integer

getEntityById() public method

Returns a media entity with a given id.
public getEntityById ( integer $id ) : Sulu\Bundle\MediaBundle\Entity\MediaInterface
$id integer
return Sulu\Bundle\MediaBundle\Entity\MediaInterface

getFormatUrls() public method

Takes an array of media ids and returns an array of formats and urls.
public getFormatUrls ( array $ids, string $locale ) : array
$ids array
$locale string
return array

getUrl() public method

Returns download url for given id and filename.
public getUrl ( string $id, string $fileName, string $version ) : string
$id string
$fileName string
$version string
return string

increaseDownloadCounter() public method

Increase the download counter of a fileVersion.
public increaseDownloadCounter ( integer $fileVersionId ) : mixed
$fileVersionId integer
return mixed

move() public method

Moves a media to a given collection.
public move ( integer $id, string $locale, integer $destCollection ) : Media
$id integer id of media
$locale string the locale which the object will be returned
$destCollection integer id of destination collection
return Sulu\Bundle\MediaBundle\Api\Media

save() public method

Creates a new media or overrides an existing one.
public save ( Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile, array $data, integer $userId ) : Media
$uploadedFile Symfony\Component\HttpFoundation\File\UploadedFile
$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\Media