Same name in other branches
  1. 8.x-1.x entity_clone.api.php \MyEntityCloneEventSubscriber::myPreClone()

An example event subscriber.

Dispatched before an entity is cloned and saved.

See also

\Drupal\entity_clone\Event\EntityCloneEvents::PRE_CLONE

File

./entity_clone.api.php, line 45

Class

MyEntityCloneEventSubscriber
Event subscribers for Entity Clone.

Code

public function myPreClone(EntityCloneEvent $event) : void {
    $original = $event->getEntity();
    $newEntity = $event->getClonedEntity();
}