3 namespace Doctrine\Tests\Models\CMS;
7 * @Table(name="cms_articles")
13 * @Column(type="integer")
14 * @GeneratedValue(strategy="AUTO")
18 * @Column(type="string", length=255)
22 * @Column(type="text")
26 * @ManyToOne(targetEntity="CmsUser", inversedBy="articles")
27 * @JoinColumn(name="user_id", referencedColumnName="id")
31 * @OneToMany(targetEntity="CmsComment", mappedBy="article")
36 * @Version @column(type="integer")
40 public function setAuthor(CmsUser $author) {
41 $this->user = $author;
44 public function addComment(CmsComment $comment) {
45 $this->comments[] = $comment;
46 $comment->setArticle($this);