PHP Class Sulu\Bundle\ContactBundle\Controller\AbstractMediaController

Inheritance: extends Sulu\Component\Rest\RestController
Mostrar archivo 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_oe static_oe property

protected static $collectionEntityName

$fieldDescriptors protected_oe property

protected $fieldDescriptors

$fileEntityName protected_oe static_oe property

protected static $fileEntityName

$fileVersionEntityName protected_oe static_oe property

protected static $fileVersionEntityName

$fileVersionMetaEntityName protected_oe static_oe property

protected static $fileVersionMetaEntityName

$mediaEntityKey protected_oe static_oe property

protected static $mediaEntityKey