src/Entity/Application/InformationTranslation.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Application;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\HttpFoundation\File\File;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use App\Entity\Behaviors\TranslationTrait;
  8. use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
  9. use JMS\Serializer\Annotation as Serializer;
  10. /**
  11. *
  12. * @ORM\Table(name="app_information_translation")
  13. * @ORM\EntityListeners({"App\Listener\EntityListener"})
  14. * @ORM\Entity(repositoryClass="App\Repository\TranslationRepository")
  15. * @Vich\Uploadable()
  16. */
  17. class InformationTranslation implements TranslationInterface
  18. {
  19. use TranslationTrait;
  20. /**
  21. * @Vich\UploadableField(mapping="cupons", fileNameProperty="image")
  22. * @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
  23. * @var File|null
  24. */
  25. private $imageFile;
  26. /**
  27. * @ORM\Column(type="string", length=255, nullable=true)
  28. */
  29. private $image;
  30. /**
  31. * @ORM\Column(type="string", length=2)
  32. */
  33. protected $locale;
  34. /**
  35. * @Serializer\Groups({"api"})
  36. * @Serializer\SerializedName("description")
  37. * @ORM\Column(type="text", nullable=true)
  38. */
  39. protected $text;
  40. /**
  41. * @ORM\Column(type="datetime")
  42. */
  43. private $createts;
  44. /**
  45. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  46. * @ORM\JoinColumn(nullable=true)
  47. */
  48. private $createUser;
  49. /**
  50. * @ORM\Column(type="datetime", nullable=true)
  51. */
  52. private $editts;
  53. /**
  54. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  55. */
  56. private $editUser;
  57. /**
  58. * Get Image1File
  59. *
  60. * @return null|File
  61. */
  62. public function getImageFile(): ?File
  63. {
  64. return $this->imageFile;
  65. }
  66. /**
  67. * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  68. */
  69. public function setImageFile(?File $imageFile = null): void
  70. {
  71. $this->imageFile = $imageFile;
  72. if (null !== $imageFile) {
  73. $this->editts = new \DateTime();
  74. }
  75. }
  76. /**
  77. * @return mixed
  78. */
  79. public function getImage()
  80. {
  81. return $this->image;
  82. }
  83. /**
  84. * @param mixed $image
  85. */
  86. public function setImage($image): void
  87. {
  88. $this->image = $image;
  89. }
  90. /**
  91. * @return mixed
  92. */
  93. public function getCreatets()
  94. {
  95. return $this->createts;
  96. }
  97. /**
  98. * @param mixed $createts
  99. */
  100. public function setCreatets($createts): void
  101. {
  102. $this->createts = $createts;
  103. }
  104. /**
  105. * @return mixed
  106. */
  107. public function getCreateUser()
  108. {
  109. return $this->createUser;
  110. }
  111. /**
  112. * @param mixed $createUser
  113. */
  114. public function setCreateUser($createUser): void
  115. {
  116. $this->createUser = $createUser;
  117. }
  118. /**
  119. * @return mixed
  120. */
  121. public function getEditts()
  122. {
  123. return $this->editts;
  124. }
  125. /**
  126. * @param mixed $editts
  127. */
  128. public function setEditts($editts): void
  129. {
  130. $this->editts = $editts;
  131. }
  132. /**
  133. * @return mixed
  134. */
  135. public function getEditUser()
  136. {
  137. return $this->editUser;
  138. }
  139. /**
  140. * @param mixed $editUser
  141. */
  142. public function setEditUser($editUser): void
  143. {
  144. $this->editUser = $editUser;
  145. }
  146. /**
  147. * @return mixed
  148. */
  149. public function getLocale(): string
  150. {
  151. return $this->locale;
  152. }
  153. /**
  154. * @param mixed $locale
  155. */
  156. public function setLocale($locale): void
  157. {
  158. $this->locale = $locale;
  159. }
  160. /**
  161. * @return mixed
  162. */
  163. public function getText()
  164. {
  165. return $this->text;
  166. }
  167. /**
  168. * @param mixed $text
  169. */
  170. public function setText($text): void
  171. {
  172. $this->text = $text;
  173. }
  174. }