Undefined index error upon $em->clear() in Symfony2

后端 未结 2 588
没有蜡笔的小新
没有蜡笔的小新 2021-02-07 05:12

I have written a Symfony command to import some data from an API. It works but the problem is my PHP memory usage increases when I insert a big JSON in my database. And my unitO

2条回答
  •  难免孤独
    2021-02-07 05:38

    Try to reset the entity manager with:

    $this->getContainer()->get('doctrine')->resetEntityManager();
    

    and then:

    $em = $this->getContainer()->get('doctrine')->getEntityManager();
    

提交回复
热议问题