PHP Class Sulu\Bundle\ContactBundle\Controller\AbstractMediaController

Inheritance: extends Sulu\Component\Rest\RestController
Show file Open project: sulu/sulu

Protected Properties

Property Type Description
$collectionEntityName
$fieldDescriptors
$fileEntityName
$fileVersionEntityName
$fileVersionMetaEntityName
$mediaEntityKey

Protected Methods

Method Description
addMediaToEntity ( string $entityName, string $id, string $mediaId ) : Media Adds a relation between a media and the entity.
getFieldsView ( $entityName ) : Response Returns the the media fields for the current entity.
getMultipleView ( string $entityName, string $routeName, AbstractContactManager $contactManager, string $id, Request $request ) : Response Returns a view containing all media of an entity.
removeMediaFromEntity ( string $entityName, string $id, string $mediaId ) : Response Removes a media from the relation with an entity.

Private Methods

Method Description
addThumbnails ( array $entities, string $locale ) : array Takes an array of entities and resets the thumbnails-property containing the media id with the actual urls to the thumbnails.
addUrls ( array $entities, string $locale ) : array Takes an array of entities and resets the url-property with the actual urls to the original file.
getFieldDescriptors ( $entityName, $id ) : DoctrineFieldDescriptor[] Returns the field-descriptors. Ensures that the descriptors get only instantiated once.
getMediaManager ( ) : Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface
initFieldDescriptors ( $entityName, $id ) Creates the array of field-descriptors.

Method Details

addMediaToEntity() protected method

Adds a relation between a media and the entity.
protected addMediaToEntity ( string $entityName, string $id, string $mediaId ) : Media
$entityName string
$id string
$mediaId string
return Sulu\Bundle\MediaBundle\Api\Media

getFieldsView() protected method

Returns the the media fields for the current entity.
protected getFieldsView ( $entityName ) : Response
$entityName
return Response

getMultipleView() protected method

Returns a view containing all media of an entity.
protected getMultipleView ( string $entityName, string $routeName, AbstractContactManager $contactManager, string $id, Request $request ) : Response
$entityName string
$routeName string
$contactManager Sulu\Bundle\ContactBundle\Contact\AbstractContactManager
$id string
$request Request
return Response

removeMediaFromEntity() protected method

Removes a media from the relation with an entity.
protected removeMediaFromEntity ( string $entityName, string $id, string $mediaId ) : Response
$entityName string
$id string
$mediaId string
return Response

Property Details

$collectionEntityName protected static property

protected static $collectionEntityName

$fieldDescriptors protected property

protected $fieldDescriptors

$fileEntityName protected static property

protected static $fileEntityName

$fileVersionEntityName protected static property

protected static $fileVersionEntityName

$fileVersionMetaEntityName protected static property

protected static $fileVersionMetaEntityName

$mediaEntityKey protected static property

protected static $mediaEntityKey