EntityEvent.php in Entity Events 2.0.x
Same filename and directory in other branches
Namespace
Drupal\entity_events\EventFile
src/Event/EntityEvent.phpView source
<?php
namespace Drupal\entity_events\Event;
use Drupal\Component\EventDispatcher\Event;
use Drupal\Core\Entity\EntityInterface;
/**
* Class to contain an entity event.
*/
class EntityEvent extends Event {
/**
* The Entity.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
private $entity;
/**
* The event type.
*
* @var \Drupal\entity_events\EntityEventType
*/
private $eventType;
/**
* Construct a new entity event.
*
* @param string $event_type
* The event type.
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity which caused the event.
*/
public function __construct($event_type, EntityInterface $entity) {
$this->entity = $entity;
$this->eventType = $event_type;
}
/**
* Method to get the entity from the event.
*/
public function getEntity() {
return $this->entity;
}
/**
* Method to get the event type.
*/
public function getEventType() {
return $this->eventType;
}
}
Classes
Name | Description |
---|---|
EntityEvent | Class to contain an entity event. |