final class ViewsDataEvent in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/views_event_dispatcher/src/Event/Views/ViewsDataEvent.php \Drupal\views_event_dispatcher\Event\Views\ViewsDataEvent
Class ViewsDataEvent.
Hierarchy
- class \Drupal\views_event_dispatcher\Event\Views\ViewsDataEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
Expanded class hierarchy of ViewsDataEvent
2 files declare their use of ViewsDataEvent
- ViewDataEventTest.php in modules/
views_event_dispatcher/ tests/ src/ Unit/ Views/ ViewDataEventTest.php - views_event_dispatcher.module in modules/
views_event_dispatcher/ views_event_dispatcher.module - Views event dispatcher submodule.
File
- modules/
views_event_dispatcher/ src/ Event/ Views/ ViewsDataEvent.php, line 13
Namespace
Drupal\views_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() : array {
return $this->data;
}
/**
* Get the dispatcher type.
*
* @return string
* The dispatcher type.
*/
public function getDispatcherType() : string {
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:: |