Skip to content

Commit

Permalink
Fixed non-flushing entity properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaplet committed Sep 28, 2024
1 parent ecd8be5 commit 607fece
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Http/Request/Collection/CreateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public function process(array $data): Response

try {
foreach (ArrayToEntity::getEntitiesToFlush()->getIterator() as $entity) {
$classMetadata = $this->em->getClassMetadata($entity::class);
$this->em->getUnitOfWork()->recomputeSingleEntityChangeSet($classMetadata, $entity);
$this->em->flush($entity);
}
$this->em->commit();
Expand Down
2 changes: 2 additions & 0 deletions src/Http/Request/Collection/UpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public function process(array $data): Response

try {
foreach (ArrayToEntity::getEntitiesToFlush()->getIterator() as $entity) {
$classMetadata = $this->em->getClassMetadata($entity::class);
$this->em->getUnitOfWork()->recomputeSingleEntityChangeSet($classMetadata, $entity);
$this->em->flush($entity);
}
$this->em->commit();
Expand Down

0 comments on commit 607fece

Please sign in to comment.