You are here

final class JsAlterEvent in Hook Event Dispatcher 8

Class JsAlterEvent.

Hierarchy

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

Expanded class hierarchy of JsAlterEvent

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

File

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

Namespace

Drupal\hook_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() {
    return $this->javascript;
  }

  /**
   * Set the javascript.
   *
   * @param array $javascript
   *   Javascript.
   */
  public function setJavascript(array $javascript) {
    $this->javascript = $javascript;
  }

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

  /**
   * Get the dispatcher type.
   *
   * @return string
   *   The dispatcher type.
   */
  public function getDispatcherType() {
    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::setJavascript public function Set the javascript.
JsAlterEvent::__construct public function JsAlterEvent constructor.