final class ViewsDataEvent in Hook Event Dispatcher 8
Class ViewsDataEvent.
Hierarchy
- class \Drupal\hook_event_dispatcher\Event\Views\ViewsDataEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
Expanded class hierarchy of ViewsDataEvent
2 files declare their use of ViewsDataEvent
- hook_event_dispatcher.module in ./
hook_event_dispatcher.module - Hook event dispatcher module.
- ViewDataEventTest.php in tests/
src/ Unit/ Views/ ViewDataEventTest.php
File
- src/
Event/ Views/ ViewsDataEvent.php, line 12
Namespace
Drupal\hook_event_dispatcher\Event\ViewsView source
final class ViewsDataEvent extends Event implements EventInterface {
/**
* New views data.
*
* @var array
*/
private $data = [];
/**
* Add data to the views data.
*
* @param array $data
* Data to add to the views data.
*
* @see \hook_views_data()
*/
public function addData(array $data) {
$this->data = \array_merge_recursive($this->data, $data);
}
/**
* Get data.
*
* @return array
* Data.
*/
public function getData() {
return $this->data;
}
/**
* Get the dispatcher type.
*
* @return string
* The dispatcher type.
*/
public function getDispatcherType() {
return HookEventDispatcherInterface::VIEWS_DATA;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ViewsDataEvent:: |
private | property | New views data. | |
ViewsDataEvent:: |
public | function | Add data to the views data. | |
ViewsDataEvent:: |
public | function | Get data. | |
ViewsDataEvent:: |
public | function |
Get the dispatcher type. Overrides EventInterface:: |