CmsComment.php 726B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Doctrine\Tests\Models\CMS;
  3. /**
  4. * @Entity
  5. * @Table(name="cms_comments")
  6. */
  7. class CmsComment
  8. {
  9. /**
  10. * @Column(type="integer")
  11. * @Id
  12. * @GeneratedValue(strategy="AUTO")
  13. */
  14. public $id;
  15. /**
  16. * @Column(type="string", length=255)
  17. */
  18. public $topic;
  19. /**
  20. * @Column(type="string")
  21. */
  22. public $text;
  23. /**
  24. * @ManyToOne(targetEntity="CmsArticle", inversedBy="comments")
  25. * @JoinColumn(name="article_id", referencedColumnName="id")
  26. */
  27. public $article;
  28. public function setArticle(CmsArticle $article) {
  29. $this->article = $article;
  30. }
  31. public function __toString() {
  32. return __CLASS__."[id=".$this->id."]";
  33. }
  34. }