Page.php 1.1 KB

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