fix compatibility of TranslatableEntityManager with the entity manager
This commit is contained in:
parent
7fceefa6d3
commit
28a4f63640
|
@ -11,10 +11,13 @@ use App\Core\Entity\EntityInterface;
|
|||
*/
|
||||
class TranslatableEntityManager extends EntityManager
|
||||
{
|
||||
protected function persist(EntityInterface $entity)
|
||||
protected function persist(EntityInterface $entity, bool $flush = true)
|
||||
{
|
||||
$this->entityManager->persist($entity);
|
||||
$this->entityManager->persist($entity, $flush);
|
||||
$entity->mergeNewTranslations();
|
||||
$this->flush();
|
||||
|
||||
if ($flush) {
|
||||
$this->flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue