From 781eb49db908fd6d51cb6fc0ff1fad1623b69dfe Mon Sep 17 00:00:00 2001 From: Benjamin Vison Date: Fri, 16 Mar 2018 10:04:32 -0400 Subject: [PATCH] Added fix for entities that just change their last timestamp --- EventListener/DoctrineEventSubscriber.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 +}