diff --git a/EventListener/DoctrineEventSubscriber.php b/EventListener/DoctrineEventSubscriber.php index 8700e95..9aadd06 100755 --- a/EventListener/DoctrineEventSubscriber.php +++ b/EventListener/DoctrineEventSubscriber.php @@ -32,6 +32,13 @@ public function onFlush(OnFlushEventArgs $args) $uow = $em->getUnitOfWork(); foreach ($uow->getScheduledEntityUpdates() as $keyEntity => $entity) { + + $changes = $uow->getEntityChangeSet($entity); + + if(count($changes) == 1 && isset($changes["lastTimestamp"])) { + $uow->detach($entity); + continue; + } $this->handleEntityChange($em, $entity); } @@ -64,4 +71,4 @@ private function handleEntityChange(EntityManagerInterface $em, $entity) { $this->syncService->updateSyncState($em, $class, $timestamp); } -} \ No newline at end of file +}