TransArticleManySlug.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. namespace Sluggable\Fixture;
  3. use Gedmo\Sluggable\Sluggable;
  4. use Gedmo\Translatable\Translatable;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity
  9. */
  10. class TransArticleManySlug implements Sluggable, Translatable
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @Gedmo\Translatable
  20. * @Gedmo\Sluggable(slugField="slug")
  21. * @ORM\Column(type="string", length=64)
  22. */
  23. private $title;
  24. /**
  25. * @Gedmo\Sluggable(slugField="uniqueSlug")
  26. * @ORM\Column(type="string", length=64)
  27. */
  28. private $uniqueTitle;
  29. /**
  30. * @Gedmo\Slug
  31. * @ORM\Column(type="string", length=128)
  32. */
  33. private $uniqueSlug;
  34. /**
  35. * @Gedmo\Translatable
  36. * @Gedmo\Sluggable(slugField="slug")
  37. * @ORM\Column(type="string", length=16)
  38. */
  39. private $code;
  40. /**
  41. * @Gedmo\Translatable
  42. * @Gedmo\Slug
  43. * @ORM\Column(type="string", length=128)
  44. */
  45. private $slug;
  46. /**
  47. * @Gedmo\Locale
  48. * Used locale to override Translation listener`s locale
  49. */
  50. private $locale;
  51. public function addComment(Comment $comment)
  52. {
  53. $comment->setArticle($this);
  54. $this->comments[] = $comment;
  55. }
  56. public function getComments()
  57. {
  58. return $this->comments;
  59. }
  60. public function setPage($page)
  61. {
  62. $this->page = $page;
  63. }
  64. public function getId()
  65. {
  66. return $this->id;
  67. }
  68. public function setTitle($title)
  69. {
  70. $this->title = $title;
  71. }
  72. public function getTitle()
  73. {
  74. return $this->title;
  75. }
  76. public function setUniqueTitle($uniqueTitle)
  77. {
  78. $this->uniqueTitle = $uniqueTitle;
  79. }
  80. public function getUniqueTitle()
  81. {
  82. return $this->uniqueTitle;
  83. }
  84. public function setCode($code)
  85. {
  86. $this->code = $code;
  87. }
  88. public function getCode()
  89. {
  90. return $this->code;
  91. }
  92. public function getSlug()
  93. {
  94. return $this->slug;
  95. }
  96. public function getUniqueSlug()
  97. {
  98. return $this->uniqueSlug;
  99. }
  100. public function setTranslatableLocale($locale)
  101. {
  102. $this->locale = $locale;
  103. }
  104. }