在数据库symfony2中持久存在多对多的关系

时间:2013-05-15 11:00:18

标签: php symfony orm doctrine

当从表单中保存我的实体时,在刷新数据库时出现以下错误:

Catchable Fatal Error: Argument 1 passed to Doctrine\Common\Collections\ArrayCollection::__construct() must be an array, object given, called in C:\wamp\www\Symfony\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php on line 519 and defined in C:\wamp\www\Symfony\vendor\doctrine\common\lib\Doctrine\Common\Collections\ArrayCollection.php line 48 

我想我是以对象形式获取它但它必须是数组集合形式 我无法理解

任何想法????

1 个答案:

答案 0 :(得分:0)

它可能是错误的绑定或实体类错误配置。但是如果没有你的更多代码,我们无法猜出出现了什么问题:)