TransArticleManySlug.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. * @ORM\Column(type="string", length=64)
  21. */
  22. private $title;
  23. /**
  24. * @ORM\Column(type="string", length=64)
  25. */
  26. private $uniqueTitle;
  27. /**
  28. * @Gedmo\Slug(fields={"uniqueTitle"})
  29. * @ORM\Column(type="string", length=128)
  30. */
  31. private $uniqueSlug;
  32. /**
  33. * @Gedmo\Translatable
  34. * @ORM\Column(type="string", length=16)
  35. */
  36. private $code;
  37. /**
  38. * @Gedmo\Translatable
  39. * @Gedmo\Slug(fields={"title", "code"})
  40. * @ORM\Column(type="string", length=128)
  41. */
  42. private $slug;
  43. /**
  44. * @Gedmo\Locale
  45. * Used locale to override Translation listener`s locale
  46. */
  47. private $locale;
  48. public function addComment(Comment $comment)
  49. {
  50. $comment->setArticle($this);
  51. $this->comments[] = $comment;
  52. }
  53. public function getComments()
  54. {
  55. return $this->comments;
  56. }
  57. public function setPage($page)
  58. {
  59. $this->page = $page;
  60. }
  61. public function getId()
  62. {
  63. return $this->id;
  64. }
  65. public function setTitle($title)
  66. {
  67. $this->title = $title;
  68. }
  69. public function getTitle()
  70. {
  71. return $this->title;
  72. }
  73. public function setUniqueTitle($uniqueTitle)
  74. {
  75. $this->uniqueTitle = $uniqueTitle;
  76. }
  77. public function getUniqueTitle()
  78. {
  79. return $this->uniqueTitle;
  80. }
  81. public function setCode($code)
  82. {
  83. $this->code = $code;
  84. }
  85. public function getCode()
  86. {
  87. return $this->code;
  88. }
  89. public function getSlug()
  90. {
  91. return $this->slug;
  92. }
  93. public function getUniqueSlug()
  94. {
  95. return $this->uniqueSlug;
  96. }
  97. public function setTranslatableLocale($locale)
  98. {
  99. $this->locale = $locale;
  100. }
  101. }