Use refreshAll() helper for batch updates

[MAILPOET-5845]
This commit is contained in:
Jan Jakes
2024-01-18 17:59:06 +01:00
committed by Aschepikov
parent d6da2af55b
commit a947dd36cd
3 changed files with 26 additions and 2 deletions

View File

@@ -308,6 +308,11 @@ class ScheduledTasksRepository extends Repository {
->setParameter('ids', $ids, Connection::PARAM_INT_ARRAY)
->getQuery()
->execute();
// update was done via DQL, make sure the entities are also refreshed in the entity manager
$this->refreshAll(function (ScheduledTaskEntity $entity) use ($ids) {
return in_array($entity->getId(), $ids, true);
});
}
/**