abstract class EntityEventSubscriber in Entity Events 8
Same name and namespace in other branches
- 2.0.x src/EventSubscriber/EntityEventSubscriber.php \Drupal\entity_events\EventSubscriber\EntityEventSubscriber
Event subscriber for entity delete event.
Hierarchy
- class \Drupal\entity_events\EventSubscriber\EntityEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of EntityEventSubscriber
File
- src/
EventSubscriber/ EntityEventSubscriber.php, line 12
Namespace
Drupal\entity_events\EventSubscriberView source
abstract class EntityEventSubscriber implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[EntityEventType::INSERT][] = [
'onEntityInsert',
800,
];
$events[EntityEventType::UPDATE][] = [
'onEntityUpdate',
800,
];
$events[EntityEventType::DELETE][] = [
'onEntityDelete',
800,
];
return $events;
}
/**
* Method called when entity is created.
*
* @param \Drupal\entity_events\Event\EntityEvent $event
* The event.
*/
public function onEntityInsert(EntityEvent $event) {
}
/**
* Method called when entity is updated.
*
* @param \Drupal\entity_events\Event\EntityEvent $event
* The event.
*/
public function onEntityUpdate(EntityEvent $event) {
}
/**
* Method called when entity is deleted.
*
* @param \Drupal\entity_events\Event\EntityEvent $event
* The event.
*/
public function onEntityDelete(EntityEvent $event) {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityEventSubscriber:: |
public static | function | ||
EntityEventSubscriber:: |
public | function | Method called when entity is deleted. | |
EntityEventSubscriber:: |
public | function | Method called when entity is created. | |
EntityEventSubscriber:: |
public | function | Method called when entity is updated. |