Get scheduled extra updates from Doctrine UnitOfWork
So, the detailed answer for this question would be something like this:
Listen to the preSoftDelete event (Symfony2 DoctrineExtensions preSoftDelete event call):
tags: - { name: doctrine.event_listener, event: preSoftDelete }
Then in your listener class, add the following method:
public function preSoftDelete(LifecycleEventArgs $args){ $entity = $args->getEntity(); $em = $args->getEntityManager(); if ($entity instanceof ETaggableInterface || $entity instanceof ETagRelatedInterface) { $entity->updateEtag('foo'); // Was not clear what $this->updateEtag() do $em->persist($entity); $classMetadata = $em->getClassMetadata(get_class($entity)); $em->getUnitOfWork()->computeChangeSet($classMetadata, $entity); }}
This will update the entity, tell to persist it, calculate the changes.
Maybe you should listen to preSoftDelete
events: https://github.com/Atlantic18/DoctrineExtensions/blob/master/lib/Gedmo/SoftDeleteable/SoftDeleteableListener.php#L74