2017-03-03 218 views
-1

我在实体映射中得到这个错误 关联EventBundle \ Entity \ Articles#comentaires指的是不存在的拥有边的字段EventBundle \ Entity \ Articles#Commentaire。 所以在实体文章 - >实体映射

/** 
* @ORM\OneToMany(targetEntity="Articles", mappedBy="Commentaire") 
*/ 
private $comentaires; 

与实体评注

/** 
    * @ORM\ManyToOne(targetEntity="Articles", inversedBy="Commentaire") 
    * @ORM\JoinColumn(name="article_id", nullable=true) 
    */ 
private $articles; 
+1

你的问题是什么?看[mcve]如何提出问题 –

回答

0

这是因为你写 “$ ​​comentaires” 而不是 “$ COM entaires” :)

我认为你的注释是错误的。你应该写:

@ORM\OneToMany(targetEntity="Commentaire", mappedBy="Articles")