src/Entity/Content/PageTranslation.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Content;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
  7. use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
  8. use Knp\DoctrineBehaviors\Model as ORMBehaviors;
  9. use App\Interfaces\Content\SluggableInterface;
  10. use App\Entity\Media\MediaInterface;
  11. use App\Entity\Media\MediaTrait;
  12. use App\Entity\SEO\SeoInterface;
  13. use App\Entity\SEO\SeoTrait;
  14. /**
  15. * Page
  16. *
  17. * @ORM\Table(name="page_translation")
  18. * @ORM\Entity(repositoryClass="App\Repository\Content\PageTranslationRepository")
  19. * @ORM\Cache(usage="READ_ONLY", region="public")
  20. */
  21. class PageTranslation implements MediaInterface, SluggableInterface, SeoInterface, TranslationInterface
  22. {
  23. use TranslationTrait;
  24. use ORMBehaviors\Sluggable\SluggableTrait;
  25. use SeoTrait {
  26. SeoTrait::__construct as __SEO_construct;
  27. }
  28. use MediaTrait {
  29. MediaTrait::__construct as __M_construct;
  30. }
  31. /**
  32. * @var int
  33. *
  34. * @ORM\Id
  35. * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true})
  36. * @ORM\GeneratedValue(strategy="IDENTITY")
  37. */
  38. protected $id;
  39. /**
  40. * @var string
  41. *
  42. * @ORM\Column(name="title", type="string", length=255)
  43. */
  44. private $title;
  45. /**
  46. * @var string
  47. *
  48. * @ORM\Column(name="slug", type="string", length=255, nullable=true)
  49. */
  50. protected $slug;
  51. /**
  52. * @var string
  53. *
  54. * @ORM\Column(name="content", type="text", nullable=true)
  55. */
  56. private $content;
  57. /**
  58. * @var string
  59. *
  60. * @ORM\Column(name="page_top", type="text", nullable=true)
  61. */
  62. private $pageTop;
  63. /**
  64. * @var string
  65. *
  66. * @ORM\Column(name="page_bottom", type="text", nullable=true)
  67. */
  68. private $pageBottom;
  69. /**
  70. * @var string
  71. *
  72. * @ORM\Column(name="locale", type="string", nullable=false)
  73. */
  74. protected $locale;
  75. /**
  76. * @var Collection
  77. *
  78. * @ORM\ManyToMany(targetEntity="App\Entity\SEO\Seo", cascade={"all"})
  79. * @ORM\JoinTable(
  80. * name="page_translation_seo",
  81. * joinColumns={@ORM\JoinColumn(name="page_translation_id", referencedColumnName="id")},
  82. * inverseJoinColumns={@ORM\JoinColumn(name="seo", referencedColumnName="id")}
  83. * )
  84. */
  85. protected $seo;
  86. // /**
  87. // * @var Collection
  88. // *
  89. // * @ORM\ManyToMany(targetEntity="App\Entity\Media\Media")
  90. // * @ORM\JoinTable(name="page_translation_media",
  91. // * joinColumns={@ORM\JoinColumn(name="page_translation_id", referencedColumnName="id")},
  92. // * inverseJoinColumns={@ORM\JoinColumn(name="media_id", referencedColumnName="id")}
  93. // * )
  94. // */
  95. // protected $media;
  96. /**
  97. * Constructor
  98. */
  99. public function __construct()
  100. {
  101. $this->__M_construct();
  102. $this->__SEO_construct();
  103. $this->seo = new ArrayCollection();
  104. }
  105. public function getId(): int
  106. {
  107. return $this->id;
  108. }
  109. /**
  110. * @return array
  111. */
  112. public function getSluggableFields()
  113. {
  114. return [ 'title' ];
  115. }
  116. /**
  117. * Set title
  118. *
  119. * @param string $title
  120. *
  121. * @return PageTranslation
  122. */
  123. public function setTitle($title)
  124. {
  125. $this->title = $title;
  126. return $this;
  127. }
  128. /**
  129. * Get title
  130. *
  131. * @return string
  132. */
  133. public function getTitle()
  134. {
  135. return $this->title;
  136. }
  137. /**
  138. * Set content
  139. *
  140. * @param string $content
  141. *
  142. * @return PageTranslation
  143. */
  144. public function setContent($content)
  145. {
  146. $this->content = $content;
  147. return $this;
  148. }
  149. /**
  150. * Get content
  151. *
  152. * @return string
  153. */
  154. public function getContent()
  155. {
  156. return $this->content;
  157. }
  158. /**
  159. * Set pageTop
  160. *
  161. * @param string $pageTop
  162. *
  163. * @return PageTranslation
  164. */
  165. public function setPageTop($pageTop)
  166. {
  167. $this->pageTop = $pageTop;
  168. return $this;
  169. }
  170. /**
  171. * Get pageTop
  172. *
  173. * @return string
  174. */
  175. public function getPageTop()
  176. {
  177. return $this->pageTop;
  178. }
  179. /**
  180. * Set pageBottom
  181. *
  182. * @param string $pageBottom
  183. *
  184. * @return PageTranslation
  185. */
  186. public function setPageBottom($pageBottom)
  187. {
  188. $this->pageBottom = $pageBottom;
  189. return $this;
  190. }
  191. /**
  192. * Get pageBottom
  193. *
  194. * @return string
  195. */
  196. public function getPageBottom()
  197. {
  198. return $this->pageBottom;
  199. }
  200. }