PHP Class Sulu\Bundle\MediaBundle\Controller\MediaController

Inheritance: extends Sulu\Component\Rest\RestController, implements FOS\RestBundle\Routing\ClassResourceInterface, implements Sulu\Component\Security\SecuredControllerInterface, use trait Sulu\Component\Rest\RequestParametersTrait
Mostrar archivo Open project: sulu/sulu

Protected Properties

Property Type Description
$entityKey string

Public Methods

Method Description
cgetAction ( Request $request ) : Response Lists all media.
deleteAction ( $id ) : Response Delete a media with the given id.
getAction ( $id, Request $request ) : Response Shows a single media with the given id.
getFieldsAction ( Request $request ) : Response returns all fields that can be used by list.
getSecuredClass ( ) : string Returns the class name of the object to check.
getSecuredObjectId ( Request $request ) : string Returns the id of the object to check.
getSecurityContext ( )
postAction ( Request $request ) : Response Creates a new media.
postTriggerAction ( integer $id, Request $request ) : Response Trigger an action for given media. Action is specified over get-action parameter.
putAction ( integer $id, Request $request ) : Response Edits the existing media with the given id.

Protected Methods

Method Description
getCollectionManager ( ) : Sulu\Bundle\MediaBundle\Collection\Manager\CollectionManagerInterface
getCollectionRepository ( ) : Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface
getFieldDescriptors ( string $locale, boolean $all = true ) : Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface[] Returns field-descriptors for media.
getSecurityChecker ( ) : Sulu\Component\Security\Authorization\SecurityCheckerInterface
moveEntity ( integer $id, Request $request ) : Response Move an entity to another collection.
saveEntity ( $id, Request $request ) : Response

Private Methods

Method Description
getListBuilder ( Request $request, array $fieldDescriptors, array $ids, array $types ) : DoctrineListBuilder Returns a list-builder for media list.

Method Details

cgetAction() public method

Lists all media.
public cgetAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

deleteAction() public method

Delete a media with the given id.
public deleteAction ( $id ) : Response
$id
return Symfony\Component\HttpFoundation\Response

getAction() public method

Shows a single media with the given id.
public getAction ( $id, Request $request ) : Response
$id
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

getCollectionManager() protected method

protected getCollectionManager ( ) : Sulu\Bundle\MediaBundle\Collection\Manager\CollectionManagerInterface
return Sulu\Bundle\MediaBundle\Collection\Manager\CollectionManagerInterface

getCollectionRepository() protected method

protected getCollectionRepository ( ) : Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface
return Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface

getFieldDescriptors() protected method

Returns field-descriptors for media.
protected getFieldDescriptors ( string $locale, boolean $all = true ) : Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface[]
$locale string
$all boolean
return Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface[]

getFieldsAction() public method

returns all fields that can be used by list.
public getFieldsAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

getSecuredClass() public method

Returns the class name of the object to check.
public getSecuredClass ( ) : string
return string

getSecuredObjectId() public method

Returns the id of the object to check.
public getSecuredObjectId ( Request $request ) : string
$request Symfony\Component\HttpFoundation\Request
return string

getSecurityChecker() protected method

protected getSecurityChecker ( ) : Sulu\Component\Security\Authorization\SecurityCheckerInterface
return Sulu\Component\Security\Authorization\SecurityCheckerInterface

getSecurityContext() public method

public getSecurityContext ( )

moveEntity() protected method

Move an entity to another collection.
protected moveEntity ( integer $id, Request $request ) : Response
$id integer
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

postAction() public method

Creates a new media.
public postAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

postTriggerAction() public method

Trigger an action for given media. Action is specified over get-action parameter.
public postTriggerAction ( integer $id, Request $request ) : Response
$id integer
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

putAction() public method

Edits the existing media with the given id.
public putAction ( integer $id, Request $request ) : Response
$id integer The id of the media to update
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

saveEntity() protected method

protected saveEntity ( $id, Request $request ) : Response
$id
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

Property Details

$entityKey protected_oe static_oe property

protected static string $entityKey
return string