You are here

class EckEntityEventVariables in Hook Event Dispatcher 8

Class EckEntityEventVariables.

Hierarchy

Expanded class hierarchy of EckEntityEventVariables

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

File

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

Namespace

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

  /**
   * Get the EckEntity.
   *
   * @return \Drupal\eck\Entity\EckEntity
   *   EckEntity.
   */
  public function getEckEntity() {
    return $this->variables['eck_entity'];
  }

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

  /**
   * {@inheritdoc}
   */
  public function getEntityBundle() {
    return $this->variables['bundle'];
  }

  /**
   * {@inheritdoc}
   */
  public function getViewMode() {
    return $this->variables['elements']['#view_mode'];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractEntityEventVariables::getEntityType public function Get the Entity type. 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.
EckEntityEventVariables::getEckEntity public function Get the EckEntity.
EckEntityEventVariables::getEntity public function Get the Entity. Overrides AbstractEntityEventVariables::getEntity
EckEntityEventVariables::getEntityBundle public function Get the Entity bundle. Overrides AbstractEntityEventVariables::getEntityBundle
EckEntityEventVariables::getViewMode public function Get the view mode. Overrides AbstractEntityEventVariables::getViewMode