public function postPersist(LifecycleEventArgs $args) { $entity = $args->getEntity(); $em = $args->getObjectManager(); if ($entity instanceof VersionableInterface) { if (!$entity->hasListener()) { $this->makeSnapshot($entity, $em); } } }