class DemoComponent
{
private EntityManagerInterface $em;
/**
* @param EntityManagerInterface $em
*/
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
/**
* @return EntityManagerInterface
*/
public function getEm(): EntityManagerInterface
{
return $this->em;
}
}Doctrine\ORM\EntityManager:
class: App\Proxy\EntityManagerProxy
App\Components\DemoComponent:
public: truepublic function testDoctrine(): void
{
$demo = self::$container->get(DemoComponent::class);
var_dump(get_class($demo->getEm())); // Doctrine\ORM\EntityManager
}public function persist($object): void
{
if (!$this->entityManager->isOpen()) {
$this->doctrine->resetManager();
$this->entityManager = $this->doctrine->getManager();
}
$this->entityManager->persist($object);
}
public function flush(): void
{
if (!$this->entityManager->isOpen()) {
$this->doctrine->resetManager();
$this->entityManager = $this->doctrine->getManager();
}
$this->entityManager->flush();
}не встречал проблемы с логированием
Если есть проблемы, создайте issue на гитхабе и напишите
flock($handle, LOCK_EX);По идее при флаше есть ошибка, нужно ее достать, а не гасить, перезапустить например EM