You are here

final class JsAlterEvent in Hook Event Dispatcher 3.x

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

Class JsAlterEvent.

Hierarchy

  • class \Drupal\core_event_dispatcher\Event\Theme\JsAlterEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface

Expanded class hierarchy of JsAlterEvent

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

File

modules/core_event_dispatcher/src/Event/Theme/JsAlterEvent.php, line 13

Namespace

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

  /**
   * Javascript.
   *
   * @var array
   */
  private $javascript;

  /**
   * AttachedAssets.
   *
   * @var \Drupal\Core\Asset\AttachedAssetsInterface
   */
  private $attachedAssets;

  /**
   * JsAlterEvent constructor.
   *
   * @param array $javascript
   *   Javascript.
   * @param \Drupal\Core\Asset\AttachedAssetsInterface $attachedAssets
   *   AttachedAssets.
   */
  public function __construct(array &$javascript, AttachedAssetsInterface $attachedAssets) {
    $this->javascript =& $javascript;
    $this->attachedAssets = $attachedAssets;
  }

  /**
   * Get the javascript.
   *
   * @return array
   *   Javascript.
   */
  public function &getJavascript() : array {
    return $this->javascript;
  }

  /**
   * Get the attached assets.
   *
   * @return \Drupal\Core\Asset\AttachedAssetsInterface
   *   AttachedAssets.
   */
  public function getAttachedAssets() : AttachedAssetsInterface {
    return $this->attachedAssets;
  }

  /**
   * Get the dispatcher type.
   *
   * @return string
   *   The dispatcher type.
   */
  public function getDispatcherType() : string {
    return HookEventDispatcherInterface::JS_ALTER;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
JsAlterEvent::$attachedAssets private property AttachedAssets.
JsAlterEvent::$javascript private property Javascript.
JsAlterEvent::getAttachedAssets public function Get the attached assets.
JsAlterEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
JsAlterEvent::getJavascript public function Get the javascript.
JsAlterEvent::__construct public function JsAlterEvent constructor.