You are here

class ToolbarAlterEvent in Hook Event Dispatcher 8

Class ToolbarAlterEvent.

Hierarchy

Expanded class hierarchy of ToolbarAlterEvent

2 files declare their use of ToolbarAlterEvent
hook_event_dispatcher.module in ./hook_event_dispatcher.module
Hook event dispatcher module.
ToolbarAlterEventTest.php in tests/src/Unit/Toolbar/ToolbarAlterEventTest.php

File

src/Event/Toolbar/ToolbarAlterEvent.php, line 12

Namespace

Drupal\hook_event_dispatcher\Event\Toolbar
View source
class ToolbarAlterEvent extends Event implements EventInterface {

  /**
   * The toolbar items.
   *
   * @var array
   */
  private $items;

  /**
   * ToolbarAlterEvent constructor.
   *
   * @param array $items
   *   The toolbar items.
   */
  public function __construct(array &$items) {
    $this->items =& $items;
  }

  /**
   * Get the items by reference.
   *
   * @return array
   *   The items.
   */
  public function &getItems() {
    return $this->items;
  }

  /**
   * Set the items.
   *
   * @param array $items
   *   The items.
   */
  public function setItems(array $items) {
    $this->items = $items;
  }

  /**
   * {@inheritdoc}
   */
  public function getDispatcherType() {
    return HookEventDispatcherInterface::TOOLBAR_ALTER;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ToolbarAlterEvent::$items private property The toolbar items.
ToolbarAlterEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
ToolbarAlterEvent::getItems public function Get the items by reference.
ToolbarAlterEvent::setItems public function Set the items.
ToolbarAlterEvent::__construct public function ToolbarAlterEvent constructor.