Page.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. * @Gedmo\Sluggable
  18. * @ORM\Column(type="string", length=255)
  19. */
  20. private $content;
  21. /**
  22. * @Gedmo\Slug(style="camel", separator="_")
  23. * @ORM\Column(type="string", length=128)
  24. */
  25. private $slug;
  26. /**
  27. * @ORM\OneToMany(targetEntity="TranslatableArticle", mappedBy="page")
  28. */
  29. private $articles;
  30. public function getId()
  31. {
  32. return $this->id;
  33. }
  34. public function addArticle(TranslatableArticle $article)
  35. {
  36. $article->setPage($this);
  37. $this->articles[] = $article;
  38. }
  39. public function getArticles()
  40. {
  41. return $this->articles;
  42. }
  43. public function setContent($content)
  44. {
  45. $this->content = $content;
  46. }
  47. public function getContent()
  48. {
  49. return $this->content;
  50. }
  51. public function getSlug()
  52. {
  53. return $this->slug;
  54. }
  55. }