You are here

public function ExampleEntityEventSubscribers::entityUpdate in Hook Event Dispatcher 8

Entity update.

Parameters

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

File

src/Example/ExampleEntityEventSubscribers.php, line 76

Class

ExampleEntityEventSubscribers
Class ExampleEntityEventSubscribers.

Namespace

Drupal\hook_event_dispatcher\Example

Code

public function entityUpdate(EntityUpdateEvent $event) {

  // Do some fancy stuff, when entity is updated.
  $entity = $event
    ->getEntity();
  $entity->special_field->value = 'Update!';
}