src/Entity/Web/SlideShowTranslation.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Web;
  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\Table(name="web_slide_show_translation")
  11. * @ORM\Entity(repositoryClass="App\Repository\TranslationRepository")
  12. * @ORM\EntityListeners({"App\Listener\EntityListener"})
  13. * @Vich\Uploadable()
  14. */
  15. class SlideShowTranslation implements TranslationInterface
  16. {
  17. use TranslationTrait;
  18. /**
  19. * @ORM\Column(type="string", length=2)
  20. */
  21. protected $locale;
  22. /**
  23. * @ORM\Column(type="string", length=255)
  24. */
  25. private string $label;
  26. /**
  27. * @ORM\Column(type="string", length=255)
  28. */
  29. private string $title;
  30. /**
  31. * @ORM\Column(type="string", length=255)
  32. */
  33. private string $subtitle;
  34. /**
  35. * @ORM\Column(type="string", length=255)
  36. */
  37. private string $url;
  38. /**
  39. * @Vich\UploadableField(mapping="slideshow", fileNameProperty="image")
  40. * @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
  41. * @var File|null
  42. */
  43. private $imageFile;
  44. /**
  45. * @ORM\Column(type="string", length=255, nullable=true)
  46. */
  47. private $image;
  48. /**
  49. * @Vich\UploadableField(mapping="slideshow_mobile", fileNameProperty="imageMobile")
  50. * @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
  51. * @var File|null
  52. */
  53. private $imageMobileFile;
  54. /**
  55. * @ORM\Column(type="string", length=255, nullable=true)
  56. */
  57. private $imageMobile;
  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 __construct($locale = null) {
  76. if($locale !== null){
  77. $this->setLocale($locale);
  78. }
  79. }
  80. public function getId(): ?int
  81. {
  82. return $this->id;
  83. }
  84. public function getLabel(): ?string
  85. {
  86. return $this->label;
  87. }
  88. public function setLabel(string $label): self
  89. {
  90. $this->label = $label;
  91. return $this;
  92. }
  93. public function getUrl(): ?string
  94. {
  95. return $this->url;
  96. }
  97. public function setUrl(string $url): self
  98. {
  99. $this->url = $url;
  100. return $this;
  101. }
  102. public function getImage(): ?string
  103. {
  104. return $this->image;
  105. }
  106. public function setImage(?string $image): self
  107. {
  108. $this->image = $image;
  109. return $this;
  110. }
  111. public function getImageMobile(): ?string
  112. {
  113. return $this->imageMobile;
  114. }
  115. public function setImageMobile(?string $imageMobile): self
  116. {
  117. $this->imageMobile = $imageMobile;
  118. return $this;
  119. }
  120. /**
  121. * Get ImageFile
  122. *
  123. * @return null|File
  124. */
  125. public function getImageFile()
  126. {
  127. return $this->imageFile;
  128. }
  129. /**
  130. * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  131. */
  132. public function setImageFile(?File $imageFile = null): void
  133. {
  134. $this->imageFile = $imageFile;
  135. if (null !== $imageFile) {
  136. $this->editts = new \DateTime();
  137. }
  138. }
  139. /**
  140. * Get ImageMobileFile
  141. *
  142. * @return null|File
  143. */
  144. public function getImageMobileFile()
  145. {
  146. return $this->imageMobileFile;
  147. }
  148. /**
  149. * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageMobileFile
  150. */
  151. public function setImageMobileFile(?File $imageMobileFile = null): void
  152. {
  153. $this->imageMobileFile = $imageMobileFile;
  154. if (null !== $imageMobileFile) {
  155. $this->editts = new \DateTime();
  156. }
  157. }
  158. /**
  159. * @return mixed
  160. */
  161. public function getCreatets()
  162. {
  163. return $this->createts;
  164. }
  165. /**
  166. * @param mixed $createts
  167. */
  168. public function setCreatets($createts): void
  169. {
  170. $this->createts = $createts;
  171. }
  172. /**
  173. * @return mixed
  174. */
  175. public function getCreateUser()
  176. {
  177. return $this->createUser;
  178. }
  179. /**
  180. * @param mixed $createUser
  181. */
  182. public function setCreateUser($createUser): void
  183. {
  184. $this->createUser = $createUser;
  185. }
  186. /**
  187. * @return mixed
  188. */
  189. public function getEditts()
  190. {
  191. return $this->editts;
  192. }
  193. /**
  194. * @param mixed $editts
  195. */
  196. public function setEditts($editts): void
  197. {
  198. $this->editts = $editts;
  199. }
  200. /**
  201. * @return mixed
  202. */
  203. public function getEditUser()
  204. {
  205. return $this->editUser;
  206. }
  207. /**
  208. * @param mixed $editUser
  209. */
  210. public function setEditUser($editUser): void
  211. {
  212. $this->editUser = $editUser;
  213. }
  214. /**
  215. * @return string
  216. */
  217. public function getTitle(): string
  218. {
  219. return $this->title;
  220. }
  221. /**
  222. * @param string $title
  223. */
  224. public function setTitle(string $title): void
  225. {
  226. $this->title = $title;
  227. }
  228. /**
  229. * @return string
  230. */
  231. public function getSubtitle(): string
  232. {
  233. return $this->subtitle;
  234. }
  235. /**
  236. * @param string $subtitle
  237. */
  238. public function setSubtitle(string $subtitle): void
  239. {
  240. $this->subtitle = $subtitle;
  241. }
  242. }