Skip to content

Commit

Permalink
Update DoctrineEventSubscriber.php
Browse files Browse the repository at this point in the history
Temporarily adding the "lastLogin", this suscriber will have to be redone with serialization comparison instead of entity changesets as Doctrine is not very reliable detecting changes...
  • Loading branch information
ntidev authored May 4, 2018
1 parent d14f79b commit c2e4404
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions EventListener/DoctrineEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function onFlush(OnFlushEventArgs $args)
foreach($identityMap as $map) {
foreach($map as $object) {
$changes = $uow->getEntityChangeSet($object);
if(count($changes) > 1 || (count($changes) > 0 && !isset($changes["lastTimestamp"]))) {
if(count($changes) > 1 || (count($changes) > 0 && !isset($changes["lastTimestamp"]) && !isset($changes["lastLogin"]))) {
$somethingChanged = true;
break;
}
Expand All @@ -59,7 +59,7 @@ public function onFlush(OnFlushEventArgs $args)
foreach ($uow->getScheduledEntityUpdates() as $keyEntity => $entity) {
$changes = $uow->getEntityChangeSet($entity);

if(count($changes) == 1 && isset($changes["lastTimestamp"]) && !$somethingChanged) {
if(count($changes) == 1 && isset($changes["lastTimestamp"]) && !isset($changes["lastLogin"]) && !$somethingChanged) {
$oid = spl_object_hash($entity);
$uow->clearEntityChangeSet($oid);
} else {
Expand Down Expand Up @@ -96,4 +96,4 @@ private function handleEntityChange(EntityManagerInterface $em, $entity) {
}


}
}

0 comments on commit c2e4404

Please sign in to comment.