class AbstractCrudController extends BaseAdminController

An abstract CRUD controller for Thelia ADMIN, to manage basic CRUD operations on a givent object.

Traits

Symfony\Component\DependencyInjection\ContainerAwareTrait

Constants

EMPTY_FORM_NAME

CONTROLLER_TYPE

TEMPLATE_404

Methods

EventDispatcher
getDispatcher()

Return the event dispatcher,

getTranslator()

return the Translator

getMailer()

return an instance of \Swift_Mailer with good Transporter configured.

createForm($name, $type = 'form', array $data = array(), array $options = array())

No description

ContainerInterface
getContainer()

No description

string
getControllerType()

No description

adminLogAppend($resource, $action, $message, $resourceId = null)

Helper to append a message to the admin log.

processTemplateAction( string $template)

This method process the rendering of view called from an admin page

__construct( string $objectName, string $defaultListOrder, string $orderRequestParameterName, string $resourceCode, string $createEventIdentifier, string $updateEventIdentifier, string $deleteEventIdentifier, string $visibilityToggleEventIdentifier = null, string $changePositionEventIdentifier = null, string $moduleCode = null)

No description

defaultAction()

The default action is displaying the list.

createAction()

Create a new object

updateAction()

Load a object for modification, and display the edit template.

processUpdateAction()

Save changes on a modified object, and either go back to the object list, or stay on the edition page.

updatePositionAction()

Update object position (only for objects whichsupport that)

setToggleVisibilityAction()

Online status toggle (only for object which support it)

deleteAction()

Delete an object

Details

in BaseController at line 128
EventDispatcher getDispatcher()

Return the event dispatcher,

Return Value

EventDispatcher

in BaseController at line 138
Translator getTranslator()

return the Translator

Return Value

Translator

in BaseController at line 545
MailerFactory getMailer()

return an instance of \Swift_Mailer with good Transporter configured.

Return Value

MailerFactory

in BaseController at line 569
BaseForm createForm($name, $type = 'form', array $data = array(), array $options = array())

Parameters

$name
$type
array $data
array $options

Return Value

BaseForm This method builds a thelia form with its name

in BaseController at line 589
ContainerInterface getContainer()

Return Value

ContainerInterface

in BaseAdminController at line 90
string getControllerType()

Return Value

string

in BaseAdminController at line 52
adminLogAppend($resource, $action, $message, $resourceId = null)

Helper to append a message to the admin log.

Parameters

$resource
$action
$message
$resourceId

in BaseAdminController at line 71
Response processTemplateAction( string $template)

This method process the rendering of view called from an admin page

Parameters

string $template the template name

Return Value

Response the response which contains the rendered view

at line 63
__construct( string $objectName, string $defaultListOrder, string $orderRequestParameterName, string $resourceCode, string $createEventIdentifier, string $updateEventIdentifier, string $deleteEventIdentifier, string $visibilityToggleEventIdentifier = null, string $changePositionEventIdentifier = null, string $moduleCode = null)

Parameters

string $objectName the lower case object name. Example. "message"
string $defaultListOrder the default object list order, or null if list is not sortable. Example: manual
string $orderRequestParameterName Name of the request parameter that set the list order (null if list is not sortable)
string $resourceCode the 'resource' code. Example: "admin.configuration.message"
string $createEventIdentifier the dispatched create TheliaEvent identifier. Example: TheliaEvents::MESSAGE_CREATE
string $updateEventIdentifier the dispatched update TheliaEvent identifier. Example: TheliaEvents::MESSAGE_UPDATE
string $deleteEventIdentifier the dispatched delete TheliaEvent identifier. Example: TheliaEvents::MESSAGE_DELETE
string $visibilityToggleEventIdentifier the dispatched visibility toggle TheliaEvent identifier, or null if the object has no visible options. Example: TheliaEvents::MESSAGETOGGLEVISIBILITY
string $changePositionEventIdentifier the dispatched position change TheliaEvent identifier, or null if the object has no position. Example: TheliaEvents::MESSAGEUPDATEPOSITION
string $moduleCode The module code for ACL

at line 290
Response defaultAction()

The default action is displaying the list.

Return Value

Response the response

at line 305
Response createAction()

Create a new object

Return Value

Response the response

at line 392
Response updateAction()

Load a object for modification, and display the edit template.

Return Value

Response the response

at line 417
Response processUpdateAction()

Save changes on a modified object, and either go back to the object list, or stay on the edition page.

Return Value

Response the response

at line 506
updatePositionAction()

Update object position (only for objects whichsupport that)

at line 581
setToggleVisibilityAction()

Online status toggle (only for object which support it)

at line 605
Response deleteAction()

Delete an object

Return Value

Response the response