You are here

class ParagraphEventVariables in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/preprocess_event_dispatcher/src/Variables/ParagraphEventVariables.php \Drupal\preprocess_event_dispatcher\Variables\ParagraphEventVariables

Class ParagraphEventVariables.

Hierarchy

Expanded class hierarchy of ParagraphEventVariables

2 files declare their use of ParagraphEventVariables
EntityEventVariablesTest.php in modules/preprocess_event_dispatcher/tests/src/Unit/EntityEventVariablesTest.php
ParagraphPreprocessEventFactory.php in modules/preprocess_event_dispatcher/src/Factory/ParagraphPreprocessEventFactory.php

File

modules/preprocess_event_dispatcher/src/Variables/ParagraphEventVariables.php, line 11

Namespace

Drupal\preprocess_event_dispatcher\Variables
View source
class ParagraphEventVariables extends AbstractEntityEventVariables {

  /**
   * Get the paragraph object.
   *
   * @return \Drupal\paragraphs\ParagraphInterface
   *   Return the paragraph object.
   */
  public function getParagraph() : ParagraphInterface {
    return $this->variables['paragraph'];
  }

  /**
   * Get the Entity.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   EckEntity.
   */
  public function getEntity() : EntityInterface {
    return $this
      ->getParagraph();
  }

}

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.
ParagraphEventVariables::getEntity public function Get the Entity. Overrides AbstractEntityEventVariables::getEntity
ParagraphEventVariables::getParagraph public function Get the paragraph object.