class EntityEvent in Entity Events 2.0.x
Same name and namespace in other branches
- 8 src/Event/EntityEvent.php \Drupal\entity_events\Event\EntityEvent
Class to contain an entity event.
Hierarchy
- class \Drupal\Component\EventDispatcher\Event extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\entity_events\Event\EntityEvent
Expanded class hierarchy of EntityEvent
6 files declare their use of EntityEvent
- EntityEventDeleteSubscriber.php in src/
EventSubscriber/ EntityEventDeleteSubscriber.php - EntityEventInsertSubscriber.php in src/
EventSubscriber/ EntityEventInsertSubscriber.php - EntityEventPresaveSubscriber.php in src/
EventSubscriber/ EntityEventPresaveSubscriber.php - EntityEventSubscriber.php in src/
EventSubscriber/ EntityEventSubscriber.php - EntityEventUpdateSubscriber.php in src/
EventSubscriber/ EntityEventUpdateSubscriber.php
File
- src/
Event/ EntityEvent.php, line 11
Namespace
Drupal\entity_events\EventView source
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityEvent:: |
private | property | The Entity. | |
EntityEvent:: |
private | property | The event type. | |
EntityEvent:: |
public | function | Method to get the entity from the event. | |
EntityEvent:: |
public | function | Method to get the event type. | |
EntityEvent:: |
public | function | Construct a new entity event. |