You are here

class PageAttachmentsEvent in Hook Event Dispatcher 8

Class PageAttachmentsEvent.

Hierarchy

Expanded class hierarchy of PageAttachmentsEvent

2 files declare their use of PageAttachmentsEvent
hook_event_dispatcher.module in ./hook_event_dispatcher.module
Hook event dispatcher module.
PageAttachmentsEventTest.php in tests/src/Unit/Page/PageAttachmentsEventTest.php

File

src/Event/Page/PageAttachmentsEvent.php, line 12

Namespace

Drupal\hook_event_dispatcher\Event\Page
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() {
    return $this->attachments;
  }

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

  /**
   * {@inheritdoc}
   */
  public function getDispatcherType() {
    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::setAttachments public function Set the attachments.
PageAttachmentsEvent::__construct public function PageAttachmentsEvent constructor.