class EntityEvent in Entity Events 8
Same name and namespace in other branches
- 2.0.x src/Event/EntityEvent.php \Drupal\entity_events\Event\EntityEvent
Class to contain an entity event.
Hierarchy
- class \Drupal\entity_events\Event\EntityEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of EntityEvent
5 files declare their use of EntityEvent
- EntityEventDeleteSubscriber.php in src/
EventSubscriber/ EntityEventDeleteSubscriber.php - EntityEventInsertSubscriber.php in src/
EventSubscriber/ EntityEventInsertSubscriber.php - EntityEventSubscriber.php in src/
EventSubscriber/ EntityEventSubscriber.php - EntityEventUpdateSubscriber.php in src/
EventSubscriber/ EntityEventUpdateSubscriber.php - entity_events.module in ./
entity_events.module - This module holds functions for entity events.
File
- src/
Event/ EntityEvent.php, line 12
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. |