You are here

class NodeEventVariables in Hook Event Dispatcher 8

Class NodeEventVariables.

Hierarchy

Expanded class hierarchy of NodeEventVariables

2 files declare their use of NodeEventVariables
EntityEventVariablesTest.php in tests/src/Unit/Preprocess/EntityEventVariablesTest.php
NodePreprocessEventFactory.php in src/Event/Preprocess/Factory/NodePreprocessEventFactory.php

File

src/Event/Preprocess/Variables/NodeEventVariables.php, line 8

Namespace

Drupal\hook_event_dispatcher\Event\Preprocess\Variables
View source
class NodeEventVariables extends AbstractEntityEventVariables {

  /**
   * Get the node.
   *
   * @return \Drupal\node\Entity\Node
   *   The node.
   */
  public function getNode() {
    return $this->variables['node'];
  }

  /**
   * {@inheritdoc}
   */
  public function getEntity() {
    return $this
      ->getNode();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractEntityEventVariables::getEntityBundle public function Get the Entity bundle. 1
AbstractEntityEventVariables::getEntityType public function Get the Entity type. 1
AbstractEntityEventVariables::getViewMode public function Get the view mode. 1
AbstractEventVariables::$variables protected property Variables.
AbstractEventVariables::get public function Get a variable with a given name, return default if it does not exist. 1
AbstractEventVariables::getByReference public function Get a variable with a given name by reference. 1
AbstractEventVariables::remove public function Remove a given variable. 1
AbstractEventVariables::set public function Set a variable to a given value. 1
AbstractEventVariables::__construct public function Event Variables constructor.
NodeEventVariables::getEntity public function Get the Entity. Overrides AbstractEntityEventVariables::getEntity
NodeEventVariables::getNode public function Get the node.