Skip to content

Commit

Permalink
Added fix for entities that just change their last timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Vison committed Mar 16, 2018
1 parent 46d2b63 commit 781eb49
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion EventListener/DoctrineEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -64,4 +71,4 @@ private function handleEntityChange(EntityManagerInterface $em, $entity) {
$this->syncService->updateSyncState($em, $class, $timestamp);
}

}
}

0 comments on commit 781eb49

Please sign in to comment.