« Programmation PHP/Problèmes connus » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 582 :
==== The EntityManager is closed ====
 
Cela survient quand l'EntityManager rencontre une exception. On peut le reconnecter<ref>https://www.kerstner.at/2014/09/doctrine-2-exception-entitymanager-closed/</ref>, ou:
* la lever avec :
<syntaxhighlight lang=php>
if ($this->em->isOpen()) {
Ligne 588 ⟶ 589 :
$this->em->flush($entity);
}
</syntaxhighlight>
 
* recréer l'entityManager :
<syntaxhighlight lang=php>
if (!$this->em->isOpen()) {
$this->em = $this->em->create(
$this->em->getConnection(),
$this->em->getConfiguration()
);
}
</syntaxhighlight>