class CommentEventVariables in Hook Event Dispatcher 8
Class CommentEventVariables.
Hierarchy
- class \Drupal\hook_event_dispatcher\Event\Preprocess\Variables\AbstractEventVariables
- class \Drupal\hook_event_dispatcher\Event\Preprocess\Variables\AbstractEntityEventVariables
- class \Drupal\hook_event_dispatcher\Event\Preprocess\Variables\CommentEventVariables
- class \Drupal\hook_event_dispatcher\Event\Preprocess\Variables\AbstractEntityEventVariables
Expanded class hierarchy of CommentEventVariables
2 files declare their use of CommentEventVariables
- CommentPreprocessEventFactory.php in src/
Event/ Preprocess/ Factory/ CommentPreprocessEventFactory.php - EntityEventVariablesTest.php in tests/
src/ Unit/ Preprocess/ EntityEventVariablesTest.php
File
- src/
Event/ Preprocess/ Variables/ CommentEventVariables.php, line 8
Namespace
Drupal\hook_event_dispatcher\Event\Preprocess\VariablesView source
class CommentEventVariables extends AbstractEntityEventVariables {
/**
* Get the comment.
*
* @return \Drupal\comment\Entity\Comment
* The comment.
*/
public function getComment() {
return $this->variables['comment'];
}
/**
* {@inheritdoc}
*/
public function getEntity() {
return $this
->getComment();
}
/**
* {@inheritdoc}
*/
public function getEntityType() {
return 'comment';
}
/**
* Get commented entity.
*
* @return \Drupal\Core\Entity\EntityInterface
* Commented entity.
*/
public function getCommentedEntity() {
return $this->variables['commented_entity'];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractEntityEventVariables:: |
public | function | Get the Entity bundle. | 1 |
AbstractEntityEventVariables:: |
public | function | Get the view mode. | 1 |
AbstractEventVariables:: |
protected | property | Variables. | |
AbstractEventVariables:: |
public | function | Get a variable with a given name, return default if it does not exist. | 1 |
AbstractEventVariables:: |
public | function | Get a variable with a given name by reference. | 1 |
AbstractEventVariables:: |
public | function | Remove a given variable. | 1 |
AbstractEventVariables:: |
public | function | Set a variable to a given value. | 1 |
AbstractEventVariables:: |
public | function | Event Variables constructor. | |
CommentEventVariables:: |
public | function | Get the comment. | |
CommentEventVariables:: |
public | function | Get commented entity. | |
CommentEventVariables:: |
public | function |
Get the Entity. Overrides AbstractEntityEventVariables:: |
|
CommentEventVariables:: |
public | function |
Get the Entity type. Overrides AbstractEntityEventVariables:: |