Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
nikophil committed Jan 16, 2025
1 parent 6024509 commit b1408bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/ORM/AbstractORMPersistenceStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ final public function hasChanges(object $object): bool
}

// cannot use UOW::recomputeSingleEntityChangeSet() here as it wrongly computes embedded objects as changed
$em->getUnitOfWork()->computeChangeSet($em->getClassMetadata($object::class), $object);
$unitOfWork = clone $em->getUnitOfWork();

$unitOfWork->computeChangeSet($em->getClassMetadata($object::class), $object);

return (bool) $em->getUnitOfWork()->getEntityChangeSet($object);
return (bool) $unitOfWork->getEntityChangeSet($object);
}

final public function truncate(string $class): void
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/PersistentObjectFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ protected function normalizeObject(object $object): object
}

try {
return $configuration->persistence()->refresh($object, true);
return $configuration->persistence()->refresh($object);
} catch (RefreshObjectFailed|VarExportLogicException) {
return $object;
}
Expand Down

0 comments on commit b1408bb

Please sign in to comment.