Page.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace Sluggable\Fixture;
  3. /**
  4. * @Entity
  5. */
  6. class Page
  7. {
  8. /**
  9. * @Id
  10. * @GeneratedValue
  11. * @Column(type="integer")
  12. */
  13. private $id;
  14. /**
  15. * @gedmo:Sluggable
  16. * @Column(type="string", length=255)
  17. */
  18. private $content;
  19. /**
  20. * @gedmo:Slug(style="camel", separator="_")
  21. * @Column(type="string", length=128)
  22. */
  23. private $slug;
  24. /**
  25. * @OneToMany(targetEntity="TranslatableArticle", mappedBy="page")
  26. */
  27. private $articles;
  28. public function getId()
  29. {
  30. return $this->id;
  31. }
  32. public function addArticle(TranslatableArticle $article)
  33. {
  34. $article->setPage($this);
  35. $this->articles[] = $article;
  36. }
  37. public function getArticles()
  38. {
  39. return $this->articles;
  40. }
  41. public function setContent($content)
  42. {
  43. $this->content = $content;
  44. }
  45. public function getContent()
  46. {
  47. return $this->content;
  48. }
  49. public function getSlug()
  50. {
  51. return $this->slug;
  52. }
  53. }