CommentEventVariables.php in Hook Event Dispatcher 8.2
File
modules/preprocess_event_dispatcher/src/Variables/CommentEventVariables.php
View source
<?php
namespace Drupal\preprocess_event_dispatcher\Variables;
use Drupal\comment\CommentInterface;
use Drupal\Core\Entity\EntityInterface;
class CommentEventVariables extends AbstractEntityEventVariables {
public function getComment() : CommentInterface {
return $this->variables['comment'];
}
public function getEntity() : EntityInterface {
return $this
->getComment();
}
public function getEntityType() : string {
return 'comment';
}
public function getCommentedEntity() : EntityInterface {
return $this->variables['commented_entity'];
}
}