You are here

final class ViewsDataAlterEvent in Hook Event Dispatcher 8

Class ViewsDataAlterEvent.

Hierarchy

Expanded class hierarchy of ViewsDataAlterEvent

2 files declare their use of ViewsDataAlterEvent
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/ViewsDataAlterEvent.php, line 12

Namespace

Drupal\hook_event_dispatcher\Event\Views
View source
final class ViewsDataAlterEvent extends Event implements EventInterface {

  /**
   * Data.
   *
   * @var array
   */
  private $data;

  /**
   * ViewsDataAlterEvent constructor.
   *
   * @param array $data
   *   Data.
   */
  public function __construct(array &$data) {
    $this->data =& $data;
  }

  /**
   * Get data by refence.
   *
   * @return array
   *   Data.
   */
  public function &getData() {
    return $this->data;
  }

  /**
   * Set data.
   *
   * @param array $data
   *   Data.
   */
  public function setData(array $data) {
    $this->data = $data;
  }

  /**
   * Get the dispatcher type.
   *
   * @return string
   *   The dispatcher type.
   */
  public function getDispatcherType() {
    return HookEventDispatcherInterface::VIEWS_DATA_ALTER;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ViewsDataAlterEvent::$data private property Data.
ViewsDataAlterEvent::getData public function Get data by refence.
ViewsDataAlterEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
ViewsDataAlterEvent::setData public function Set data.
ViewsDataAlterEvent::__construct public function ViewsDataAlterEvent constructor.