You are here

class PageAttachmentsEvent in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/core_event_dispatcher/src/Event/Theme/PageAttachmentsEvent.php \Drupal\core_event_dispatcher\Event\Theme\PageAttachmentsEvent

Class PageAttachmentsEvent.

Hierarchy

Expanded class hierarchy of PageAttachmentsEvent

2 files declare their use of PageAttachmentsEvent
core_event_dispatcher.module in modules/core_event_dispatcher/core_event_dispatcher.module
Core event dispatcher submodule.
PageEventTest.php in modules/core_event_dispatcher/tests/src/Unit/Theme/PageEventTest.php

File

modules/core_event_dispatcher/src/Event/Theme/PageAttachmentsEvent.php, line 12

Namespace

Drupal\core_event_dispatcher\Event\Theme
View source
class PageAttachmentsEvent extends Event implements EventInterface {

  /**
   * The attachments array.
   *
   * @var array
   */
  private $attachments;

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

  /**
   * Get the attachments array.
   *
   * @return array
   *   The attachments array.
   */
  public function &getAttachments() : array {
    return $this->attachments;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
PageAttachmentsEvent::$attachments private property The attachments array.
PageAttachmentsEvent::getAttachments public function Get the attachments array.
PageAttachmentsEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
PageAttachmentsEvent::__construct public function PageAttachmentsEvent constructor.