final class ViewsQuerySubstitutionsEvent in Hook Event Dispatcher 8
Class ViewsQuerySubstitutionEvent.
@package Drupal\hook_event_dispatcher\Event\Views
Hierarchy
- class \Drupal\hook_event_dispatcher\Event\Views\BaseViewsEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
- class \Drupal\hook_event_dispatcher\Event\Views\ViewsQuerySubstitutionsEvent
Expanded class hierarchy of ViewsQuerySubstitutionsEvent
3 files declare their use of ViewsQuerySubstitutionsEvent
- ExampleViewsEventSubscribers.php in src/
Example/ ExampleViewsEventSubscribers.php - hook_event_dispatcher.module in ./
hook_event_dispatcher.module - Hook event dispatcher module.
- ViewEventTest.php in tests/
src/ Unit/ Views/ ViewEventTest.php
File
- src/
Event/ Views/ ViewsQuerySubstitutionsEvent.php, line 12
Namespace
Drupal\hook_event_dispatcher\Event\ViewsView source
final class ViewsQuerySubstitutionsEvent extends BaseViewsEvent {
/**
* Views query substitutions.
*
* @var array
*/
private $substitutions = [];
/**
* Set the query substitutions.
*
* @param array $substitutions
* An associative array where each key is a string to be replaced, and the
* corresponding value is its replacement. The strings to replace are often
* surrounded with '***', as illustrated in the example implementation, to
* avoid collisions with other values in the query.
*/
public function setSubstitutions(array $substitutions) {
$this->substitutions = $substitutions;
}
/**
* Get the query substitutions.
*
* @return array
* An associative array where each key is a string to be replaced, and the
* corresponding value is its replacement. The strings to replace are often
* surrounded with '***', as illustrated in the example implementation, to
* avoid collisions with other values in the query.
*/
public function &getSubstitutions() {
return $this->substitutions;
}
/**
* Get the dispatcher type.
*
* @return string
* The dispatcher type.
*/
public function getDispatcherType() {
return HookEventDispatcherInterface::VIEWS_QUERY_SUBSTITUTIONS;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BaseViewsEvent:: |
private | property | The view. | |
BaseViewsEvent:: |
public | function | Get the view. | |
BaseViewsEvent:: |
public | function | ViewsPreExecuteEevent constructor. | 3 |
ViewsQuerySubstitutionsEvent:: |
private | property | Views query substitutions. | |
ViewsQuerySubstitutionsEvent:: |
public | function |
Get the dispatcher type. Overrides EventInterface:: |
|
ViewsQuerySubstitutionsEvent:: |
public | function | Get the query substitutions. | |
ViewsQuerySubstitutionsEvent:: |
public | function | Set the query substitutions. |