You are here

class ToolbarAlterEvent in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/toolbar_event_dispatcher/src/Event/Toolbar/ToolbarAlterEvent.php \Drupal\toolbar_event_dispatcher\Event\Toolbar\ToolbarAlterEvent

Class ToolbarAlterEvent.

Hierarchy

Expanded class hierarchy of ToolbarAlterEvent

2 files declare their use of ToolbarAlterEvent
ToolbarAlterEventTest.php in modules/toolbar_event_dispatcher/tests/src/Unit/Toolbar/ToolbarAlterEventTest.php
toolbar_event_dispatcher.module in modules/toolbar_event_dispatcher/toolbar_event_dispatcher.module
Toolbar event dispatcher submodule.

File

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

Namespace

Drupal\toolbar_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() : array {
    return $this->items;
  }

  /**
   * {@inheritdoc}
   */
  public function getDispatcherType() : string {
    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::__construct public function ToolbarAlterEvent constructor.