You are here

class LibraryInfoAlterEvent in Hook Event Dispatcher 8

Class LibraryInfoAlterEvent.

Hierarchy

Expanded class hierarchy of LibraryInfoAlterEvent

2 files declare their use of LibraryInfoAlterEvent
hook_event_dispatcher.module in ./hook_event_dispatcher.module
Hook event dispatcher module.
LibraryInfoAlterEventTest.php in tests/src/Unit/Theme/LibraryInfoAlterEventTest.php

File

src/Event/Theme/LibraryInfoAlterEvent.php, line 12

Namespace

Drupal\hook_event_dispatcher\Event\Theme
View source
class LibraryInfoAlterEvent extends Event implements EventInterface {

  /**
   * Libraries.
   *
   * @var array
   */
  private $libraries;

  /**
   * Extension machine name.
   *
   * @var string
   */
  private $extension;

  /**
   * LibraryInfoAlterEvent constructor.
   *
   * @param array $libraries
   *   An associative array of libraries registered by $extension.
   *   Keyed by internal library.
   * @param string $extension
   *   Can either be 'core' or the machine name of the extension
   *   that registered the libraries.
   */
  public function __construct(array &$libraries, $extension) {
    $this->libraries =& $libraries;
    $this->extension = $extension;
  }

  /**
   * Get libraries info.
   *
   * @return array
   *   Libraries info.
   */
  public function &getLibraries() {
    return $this->libraries;
  }

  /**
   * Get the extension.
   *
   * @return string
   *   The extension.
   */
  public function getExtension() {
    return $this->extension;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
LibraryInfoAlterEvent::$extension private property Extension machine name.
LibraryInfoAlterEvent::$libraries private property Libraries.
LibraryInfoAlterEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
LibraryInfoAlterEvent::getExtension public function Get the extension.
LibraryInfoAlterEvent::getLibraries public function Get libraries info.
LibraryInfoAlterEvent::__construct public function LibraryInfoAlterEvent constructor.