与学说2中的实体的关系出错

时间:2014-02-17 20:27:23

标签: php doctrine-orm many-to-many entity-relationship

我的实体之间的关系出错了。当我使用我的实体创建数据库时没有错误,但如果我尝试找到一个元素的关系,则会返回错误:

  

参数1传递给Doctrine \ ORM \ Mapping \ DefaultQuoteStrategy :: getJoinColumnName()必须是数组类型,给定null,在C:\ xampp \ htdocs \ myproject \ vendor \ doctrine \ orm \ lib \ Doctrine \中调用第1670行的ORM \ Persisters \ BasicEntityPersister.php,在第66行的C:\ xampp \ htdocs \ myproject \ vendor \ doctrine \ orm \ lib \ Doctrine \ ORM \ Mapping \ DefaultQuoteStrategy.php中定义。

我的关系是:

Role.php

 * @ORM\ManyToMany(targetEntity="Application\Model\User", inversedBy="idRole")
 * @ORM\JoinTable(name="UserRole")
 */     
protected $idUser;

user.php的

 * @ORM\ManyToMany(targetEntity="Login\Model\Role", mappedBy="idUser")
 */
protected $idRole;

我尝试了documentation of doctrine ORM中列出的其他方法,但我收到同样的错误。

我如何纠正这个问题?

0 个答案:

没有答案