实体映射

时间:2017-03-03 09:25:57

标签: entity symfony

我在实体映射中遇到此错误 关联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 个答案:

答案 0 :(得分:0)

这是因为你写了" $ comentaires"而不是" $ com m entaires" :)

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

@ORM\OneToMany(targetEntity="Commentaire", mappedBy="Articles")
相关问题