PHP Class Elcodi\Admin\CoreBundle\Controller\Abstracts\AbstractAdminController

Inheritance: extends Symfony\Bundle\FrameworkBundle\Controller\Controller
Show file Open project: elcodi/bamboo Class Usage Examples

Protected Methods

Method Description
deleteAction ( Request $request, Mixed $entity, string $redirectPath = null ) : RedirectResponse Updated edited element action
disableAction ( Request $request, Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity ) : array Disable entity
disableEntity ( Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity ) Disables the given entity
enableAction ( Request $request, Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity ) : array Enable entity
enableEntity ( Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity ) Enables the given entity
flush ( mixed $entity ) Save an entity. To ensure the method is simple, the entity will be persisted always
flushCache ( ) Flush cache
getFailResponse ( Request $request, Exception $exception ) : mixed Return fail response
getOkResponse ( Request $request, string $redirectPath = null ) : mixed Return ok response
getResponse ( Request $request, Closure $closure, string $redirectPath = null ) : mixed Return response
redirectRoute ( string $route, array $params = [] ) : RedirectResponse Return a RedirectResponse given a route name and an array of parameters
translate ( string $string ) : string Translate

Private Methods

Method Description
getManagerForClass ( Mixed $entity ) : Doctrine\Common\Persistence\ObjectManager Get entity manager from an entity

Method Details

deleteAction() protected method

Updated edited element action
protected deleteAction ( Request $request, Mixed $entity, string $redirectPath = null ) : RedirectResponse
$request Symfony\Component\HttpFoundation\Request Request
$entity Mixed Entity to delete
$redirectPath string Redirect path
return Symfony\Component\HttpFoundation\RedirectResponse Redirect response

disableAction() protected method

Disable entity
protected disableAction ( Request $request, Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity ) : array
$request Symfony\Component\HttpFoundation\Request Request
$entity Elcodi\Component\Core\Entity\Interfaces\EnabledInterface Entity to disable
return array Result

disableEntity() protected method

Disables the given entity
protected disableEntity ( Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity )
$entity Elcodi\Component\Core\Entity\Interfaces\EnabledInterface The entity to disable

enableAction() protected method

Enable entity
protected enableAction ( Request $request, Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity ) : array
$request Symfony\Component\HttpFoundation\Request Request
$entity Elcodi\Component\Core\Entity\Interfaces\EnabledInterface Entity to enable
return array Result

enableEntity() protected method

Enables the given entity
protected enableEntity ( Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity )
$entity Elcodi\Component\Core\Entity\Interfaces\EnabledInterface The entity to disable

flush() protected method

Save an entity. To ensure the method is simple, the entity will be persisted always
protected flush ( mixed $entity )
$entity mixed Entity

flushCache() protected method

Flush cache
protected flushCache ( )

getFailResponse() protected method

This method takes into account the type of the request ( GET or POST )
protected getFailResponse ( Request $request, Exception $exception ) : mixed
$request Symfony\Component\HttpFoundation\Request Request
$exception Exception Exception
return mixed Response

getOkResponse() protected method

This method takes into account the type of the request ( GET or POST )
protected getOkResponse ( Request $request, string $redirectPath = null ) : mixed
$request Symfony\Component\HttpFoundation\Request Request
$redirectPath string Redirect path
return mixed Response

getResponse() protected method

This method takes into account the type of the request ( GET or POST )
protected getResponse ( Request $request, Closure $closure, string $redirectPath = null ) : mixed
$request Symfony\Component\HttpFoundation\Request Request
$closure Closure Closure
$redirectPath string Redirect path
return mixed Response

redirectRoute() protected method

Return a RedirectResponse given a route name and an array of parameters
protected redirectRoute ( string $route, array $params = [] ) : RedirectResponse
$route string Route
$params array Params
return Symfony\Component\HttpFoundation\RedirectResponse Response

translate() protected method

Translate
protected translate ( string $string ) : string
$string string String to be translated
return string String translated