You are here

public function ExampleEntityEventSubscribers::entityDelete in Hook Event Dispatcher 8

Entity delete.

Parameters

\Drupal\hook_event_dispatcher\Event\Entity\EntityDeleteEvent $event: The event.

File

src/Example/ExampleEntityEventSubscribers.php, line 100

Class

ExampleEntityEventSubscribers
Class ExampleEntityEventSubscribers.

Namespace

Drupal\hook_event_dispatcher\Example

Code

public function entityDelete(EntityDeleteEvent $event) {

  // Do some fancy stuff, after entity is deleted.
  $entity = $event
    ->getEntity();
  $entity->special_field->value = 'Deleted!';
}