class StaticPagesBlockElementsListener extends AbstractBlockElementListener

Class StaticPagesBlockElementsListener is listener class for handling logic for block elements

Properties

protected BasicEntityManagerInterface $manager from AbstractBlockElementListener
protected BasicEntityManagerInterface $listener from AbstractBlockElementListener

Methods

__construct(BasicEntityManagerInterface $manager, BaseAbstractBlockElementListener $listener, mixed $class)

AbstractBlockElementListener constructor.

getEntityData(EventWithResult $event)

Return array of data for add/edit Data must contain

getTwigContent(EventWithResult $event)

Return content of twig file. This content should contain call to extension and include template to be rendered.

getAlgorithmParams(EventWithResult $event)

Return array of params for selected algorithm

getNames(EventWithResult $event)

Return array of elements containing id and entity name This will be used for display on edit page Name of entity must have key 'name'

getAlgorithms(EventWithResult $event)

Returns filtered list of algorithms

string
renderTwigTemplate(array $paramBag)

Example of twig content: {% set data = alligator_get_static_pages_by_id([".implode(',', $paramBag['entityIds'])."]) %} {% set title = "'.$paramBag['title'].'" %} {% include [currentTheme ~ \'/Plugins/EmpireBlockElementsPlugin/views/'.$paramBag['template'].'\', \'@blockElementsPluginViews/'.$paramBag['template'].'\'] ignore missing %}

mixed|null
getTwigFunction(EventWithResult $event)

No description

null|array
getAvailableAlgorithms()

No description

string
getClassName(mixed $class)

Returns short class name

array
proceedResultDataParams()

No description

Details

__construct(BasicEntityManagerInterface $manager, BaseAbstractBlockElementListener $listener, mixed $class)

AbstractBlockElementListener constructor.

Parameters

BasicEntityManagerInterface $manager
BaseAbstractBlockElementListener $listener
mixed $class

Exceptions

ReflectionException

final EventWithResult getEntityData(EventWithResult $event)

Return array of data for add/edit Data must contain

'entityName' -> name of the entity - will be displayed to user. Example 'Static Page' 'entityKey' -> key to be used - same as entityName but as one word. Example 'static_page' 'searchRouteName' -> route name for entity search. Use jQgrid route. Example 'backend_static_page_all_json' 'searchField' -> field to be searched - title of entity. Example 'title' 'language' -> if entity is language dependant

Parameters

EventWithResult $event

Return Value

EventWithResult

final EventWithResult getTwigContent(EventWithResult $event)

Return content of twig file. This content should contain call to extension and include template to be rendered.

Parameters

EventWithResult $event

Return Value

EventWithResult

Exceptions

Twig_Error_Loader
Twig_Error_Runtime
Twig_Error_Syntax

final EventWithResult getAlgorithmParams(EventWithResult $event)

Return array of params for selected algorithm

Parameters

EventWithResult $event

Return Value

EventWithResult

final EventWithResult getNames(EventWithResult $event)

Return array of elements containing id and entity name This will be used for display on edit page Name of entity must have key 'name'

Parameters

EventWithResult $event

Return Value

EventWithResult

EventWithResult getAlgorithms(EventWithResult $event)

Returns filtered list of algorithms

Parameters

EventWithResult $event

Return Value

EventWithResult

protected string renderTwigTemplate(array $paramBag)

Example of twig content: {% set data = alligator_get_static_pages_by_id([".implode(',', $paramBag['entityIds'])."]) %} {% set title = "'.$paramBag['title'].'" %} {% include [currentTheme ~ \'/Plugins/EmpireBlockElementsPlugin/views/'.$paramBag['template'].'\', \'@blockElementsPluginViews/'.$paramBag['template'].'\'] ignore missing %}

Parameters

array $paramBag

Return Value

string

Exceptions

Twig_Error_Loader
Twig_Error_Runtime
Twig_Error_Syntax

at line 36
protected mixed|null getTwigFunction(EventWithResult $event)

Parameters

EventWithResult $event

Return Value

mixed|null

at line 46
protected null|array getAvailableAlgorithms()

Return Value

null|array

protected string getClassName(mixed $class)

Returns short class name

Parameters

mixed $class

Return Value

string

at line 26
protected array proceedResultDataParams()

Return Value

array