class MyEventSubscriber in Recurring Dates Field 8.2
Same name and namespace in other branches
- 3.x date_recur.api.php \MyEventSubscriber
- 3.0.x date_recur.api.php \MyEventSubscriber
- 3.1.x date_recur.api.php \MyEventSubscriber
Event subscribers for Recurring Date Field.
Define a service, e.g: <code> ```yaml my_module.my_event_subscriber: class: Drupal\my_module\EventSubscriber\MyEventSubscriber tags:
- { name: event_subscriber }
``` </code>
Hierarchy
- class \MyEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of MyEventSubscriber
File
- ./
date_recur.api.php, line 32 - Contains hooks and event examples for date_recur module.
View source
class MyEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface {
/**
* Dispatched after an entity containing a date recur field is saved.
*
* @param \Drupal\date_recur\Event\DateRecurValueEvent $event
* The date recur value event.
*
* @see \Drupal\date_recur\Event\DateRecurEvents::FIELD_VALUE_SAVE
* Event name.
* @see \Drupal\date_recur\Plugin\Field\FieldType\DateRecurFieldItemList::postSave
* Dispatched by.
* @see \Drupal\date_recur\DateRecurOccurrences::onSave
* Live example.
*/
public function onSave(\Drupal\date_recur\Event\DateRecurValueEvent $event) : void {
}
/**
* Dispatched when an entity containing date recur fields is almost deleted.
*
* @param \Drupal\date_recur\Event\DateRecurValueEvent $event
* The date recur value event.
*
* @see \Drupal\date_recur\Event\DateRecurEvents::FIELD_ENTITY_DELETE
* Event name.
* @see \Drupal\date_recur\Plugin\Field\FieldType\DateRecurFieldItemList::delete
* Dispatched by.
* @see \Drupal\date_recur\DateRecurOccurrences::onEntityDelete
* Live example.
*/
public function onEntityDelete(\Drupal\date_recur\Event\DateRecurValueEvent $event) : void {
}
/**
* Dispatched when an entity revision is deleted.
*
* @param \Drupal\date_recur\Event\DateRecurValueEvent $event
* The date recur value event.
*
* @see \Drupal\date_recur\Event\DateRecurEvents::FIELD_REVISION_DELETE
* Event name.
* @see \Drupal\date_recur\Plugin\Field\FieldType\DateRecurFieldItemList::deleteRevision
* Dispatched by.
* @see \Drupal\date_recur\DateRecurOccurrences::onEntityRevisionDelete
* Live example.
*/
public function onEntityRevisionDelete(\Drupal\date_recur\Event\DateRecurValueEvent $event) : void {
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() : array {
return [
\Drupal\date_recur\Event\DateRecurEvents::FIELD_VALUE_SAVE => [
'onSave',
],
\Drupal\date_recur\Event\DateRecurEvents::FIELD_ENTITY_DELETE => [
'onEntityDelete',
],
\Drupal\date_recur\Event\DateRecurEvents::FIELD_REVISION_DELETE => [
'onEntityRevisionDelete',
],
];
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MyEventSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
MyEventSubscriber:: |
public | function | Dispatched when an entity containing date recur fields is almost deleted. | |
MyEventSubscriber:: |
public | function | Dispatched when an entity revision is deleted. | |
MyEventSubscriber:: |
public | function | Dispatched after an entity containing a date recur field is saved. |