You are here

public function MyEntityCloneEventSubscriber::myPostClone in Entity Clone 8

An example event subscriber.

Dispatched after an entity is cloned and saved.

See also

\Drupal\entity_clone\Event\EntityCloneEvents::POST_CLONE

File

./entity_clone.api.php, line 49
Entity Clone hooks and events.

Class

MyEntityCloneEventSubscriber
Event subscribers for Entity Clone.

Code

public function myPostClone(\Drupal\entity_clone\Event\EntityCloneEvent $event) : void {
  $original = $event
    ->getEntity();
  $newEntity = $event
    ->getClonedEntity();
}