gotem_content_moderation-1.1.6-alpha1/src/Event/ContentModerationEvent.php
src/Event/ContentModerationEvent.php
<?php
namespace Drupal\gotem\Event;
use Symfony\Contracts\EventDispatcher\Event;
use Drupal\Core\Entity\EntityInterface;
/**
* Event triggered for content moderation.
*/
class ContentModerationEvent extends Event {
/**
* The event name.
*
* This constant is used to identify the event when dispatching or subscribing.
*/
public const EVENT_NAME = 'gotem.content_moderation';
/**
* The entity being moderated.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
protected EntityInterface $entity;
/**
* Constructs a new ContentModerationEvent.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity to be moderated.
*/
public function __construct(EntityInterface $entity) {
$this->entity = $entity;
}
/**
* Gets the entity associated with the event.
*
* @return \Drupal\Core\Entity\EntityInterface
* The entity to be moderated.
*/
public function getEntity(): EntityInterface {
return $this->entity;
}
}
