AbstractBlockElementListener
abstract class AbstractBlockElementListener implements BaseBlockElementListenerInterface
Class AbstractBlockElementListener. This abstract listener must be extended by all custom block element listeners
Properties
| protected BasicEntityManagerInterface | $manager | ||
| protected BasicEntityManagerInterface | $listener |
Methods
AbstractBlockElementListener constructor.
Return content of twig file. This content should contain call to extension and include template to be rendered.
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'
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 %}
Returns function name that will be used in @blockElementsPluginViews/block/block-content.html.twig Example: return 'block_example_extension'
Returns list of all available algorithms with their params or null if they do not exists
Returns short class name
Returns array [$key => $value], where $key can be searchRouteName, searchField, algorithm, algorithmName
Details
at line 61
__construct(BasicEntityManagerInterface $manager, BaseAbstractBlockElementListener $listener, mixed $class)
AbstractBlockElementListener constructor.
at line 99
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
at line 115
final EventWithResult
getTwigContent(EventWithResult $event)
Return content of twig file. This content should contain call to extension and include template to be rendered.
at line 143
final EventWithResult
getAlgorithmParams(EventWithResult $event)
Return array of params for selected algorithm
at line 165
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'
at line 178
EventWithResult
getAlgorithms(EventWithResult $event)
Returns filtered list of algorithms
at line 212
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 %}
at line 225
protected mixed|null
getTwigFunction(EventWithResult $event)
Returns function name that will be used in @blockElementsPluginViews/block/block-content.html.twig Example: return 'block_example_extension'
at line 234
protected null|array
getAvailableAlgorithms()
Returns list of all available algorithms with their params or null if they do not exists
at line 245
protected string
getClassName(mixed $class)
Returns short class name
at line 258
protected array
proceedResultDataParams()
Returns array [$key => $value], where $key can be searchRouteName, searchField, algorithm, algorithmName