src/Entity/SlideTranslation.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Entity\Behaviors\TranslationTrait;
  5. use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10. * @ORM\Entity(repositoryClass="App\Repository\TranslationRepository")
  11. * @ORM\HasLifecycleCallbacks()
  12. * @ORM\EntityListeners({"App\Listener\EntityListener"})
  13. * @Vich\Uploadable()
  14. */
  15. class SlideTranslation implements TranslationInterface
  16. {
  17. use TranslationTrait;
  18. /**
  19. * @Vich\UploadableField(mapping="slide_image", fileNameProperty="image")
  20. * @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
  21. * @var File|null
  22. */
  23. private $imageFile;
  24. /**
  25. * @ORM\Column(type="string", length=199, nullable=true)
  26. */
  27. private $image;
  28. /**
  29. * @Vich\UploadableField(mapping="slide_image", fileNameProperty="imageMobile")
  30. * @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
  31. * @var File|null
  32. */
  33. private $imageMobileFile;
  34. /**
  35. * @ORM\Column(type="string", length=199, nullable=true)
  36. */
  37. private $imageMobile;
  38. /**
  39. * @ORM\Column(type="string", nullable=true)
  40. */
  41. protected $h1;
  42. /**
  43. * @ORM\Column(type="string", nullable=true)
  44. */
  45. protected $h2;
  46. /**
  47. * @ORM\Column(type="text", nullable=true)
  48. */
  49. protected $text;
  50. /**
  51. * @ORM\Column(type="string", nullable=true)
  52. */
  53. protected $url;
  54. /**
  55. * @ORM\Column(type="string", length=2)
  56. */
  57. protected $locale;
  58. /**
  59. * @ORM\Column(type="datetime")
  60. */
  61. private $createts;
  62. /**
  63. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  64. * @ORM\JoinColumn(nullable=false)
  65. */
  66. private $createUser;
  67. /**
  68. * @ORM\Column(type="datetime", nullable=true)
  69. */
  70. private $editts;
  71. /**
  72. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  73. */
  74. private $editUser;
  75. public function getCreatets(): ?\DateTimeInterface
  76. {
  77. return $this->createts;
  78. }
  79. public function setCreatets(\DateTimeInterface $createts): self
  80. {
  81. $this->createts = $createts;
  82. return $this;
  83. }
  84. public function getCreateUser(): ?User
  85. {
  86. return $this->createUser;
  87. }
  88. public function setCreateUser(?User $createUser): self
  89. {
  90. $this->createUser = $createUser;
  91. return $this;
  92. }
  93. public function getEditts(): ?\DateTimeInterface
  94. {
  95. return $this->editts;
  96. }
  97. public function setEditts(?\DateTimeInterface $editts): self
  98. {
  99. $this->editts = $editts;
  100. return $this;
  101. }
  102. public function getEditUser(): ?User
  103. {
  104. return $this->editUser;
  105. }
  106. public function setEditUser(?User $editUser): self
  107. {
  108. $this->editUser = $editUser;
  109. return $this;
  110. }
  111. /**
  112. * Get Text
  113. *
  114. * @return mixed
  115. */
  116. public function getText()
  117. {
  118. return $this->text;
  119. }
  120. /**
  121. * Set Text
  122. *
  123. * @param mixed $text
  124. */
  125. public function setText( $text )
  126. {
  127. $this->text = $text;
  128. }
  129. /**
  130. * Get Url
  131. *
  132. * @return mixed
  133. */
  134. public function getUrl()
  135. {
  136. return $this->url;
  137. }
  138. /**
  139. * Set Url
  140. *
  141. * @param mixed $url
  142. */
  143. public function setUrl( $url )
  144. {
  145. $this->url = $url;
  146. }
  147. /**
  148. * @return mixed
  149. */
  150. public function getH1()
  151. {
  152. return $this->h1;
  153. }
  154. /**
  155. * @param mixed $h1
  156. */
  157. public function setH1($h1): void
  158. {
  159. $this->h1 = $h1;
  160. }
  161. /**
  162. * @return mixed
  163. */
  164. public function getH2()
  165. {
  166. return $this->h2;
  167. }
  168. /**
  169. * @param mixed $h2
  170. */
  171. public function setH2($h2): void
  172. {
  173. $this->h2 = $h2;
  174. }
  175. public function getImage(): ?string
  176. {
  177. return $this->image;
  178. }
  179. public function setImage(?string $image): self
  180. {
  181. $this->image = $image;
  182. return $this;
  183. }
  184. public function getImageMobile(): ?string
  185. {
  186. return $this->imageMobile;
  187. }
  188. public function setImageMobile(?string $image): self
  189. {
  190. $this->imageMobile = $image;
  191. return $this;
  192. }
  193. /**
  194. * Get ImageFile
  195. *
  196. * @return null|File
  197. */
  198. public function getImageFile()
  199. {
  200. return $this->imageFile;
  201. }
  202. /**
  203. * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  204. */
  205. public function setImageFile(?File $imageFile = null): void
  206. {
  207. $this->imageFile = $imageFile;
  208. if (null !== $imageFile) {
  209. $this->editts = new \DateTime();
  210. }
  211. }
  212. /**
  213. * Get ImageFile
  214. *
  215. * @return null|File
  216. */
  217. public function getImageMobileFile()
  218. {
  219. return $this->imageMobileFile;
  220. }
  221. /**
  222. * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  223. */
  224. public function setImageMobileFile(?File $imageFile = null): void
  225. {
  226. $this->imageMobileFile = $imageFile;
  227. if (null !== $imageFile) {
  228. $this->editts = new \DateTime();
  229. }
  230. }
  231. }