我之前也发布了这个问题,我再次发布它,因为它尚未解决多个实体管理
我使用的Symfony2我的申请,我需要建立两个数据库连接,即读,写操作此我搜索,轻松地发现,我们可以创建不同的实体管理器和我创建这样的:
我parameters.ini文件 http://dpaste.com/hold/800957/
我config.yml文件 http://dpaste.com/hold/800954/
我的用户实体类 http://dpaste.com/hold/800963/
我跟随实体类: http://dpaste.com/hold/800964/
在控制器使物体
$emWrite = $this->getDoctrine()->getEntityManager('write');
$em = $this->getDoctrine()->getEntityManager();
当我坚持的实体它给了我下面的错误:
A new entity was found through the relationship '
AppBundle\Entity\Follower#user' that was not configured to cascade persist
operations for entity: adeel. Explicitly persist the new entity or configure
cascading persist operations on the relationship. If you cannot find out which
entity causes the problem implement AppBundle\Entity\User#__toString()
to get a clue. (500 Internal Server Error)
please hel p我详细,因为这对我来说是创造出巨大的问题......正如我已经尝试过想放弃的参与实体双方坚持房地产这么多的事情......
请帮我....
我也在分享我的实体,但我已经试过这个,但它没有工作... –
@MuhammadUmair我想在两个实体管理器之间共享实体并不是一个好的选择,你不能做类似于坚持到的东西级联行动.... – DonCallisto
我已编辑我的问题,并给实体详细信息,请检查它并详细说明你的答案,因为我是新手... –