src/Entity/Application/NotificationTranslation.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Application;
  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. use JMS\Serializer\Annotation as Serializer;
  10. /**
  11. * @ORM\Table(name="app_notification_translation")
  12. * @ORM\Entity(repositoryClass="App\Repository\TranslationRepository")
  13. * @ORM\HasLifecycleCallbacks()
  14. * @Vich\Uploadable()
  15. */
  16. class NotificationTranslation implements TranslationInterface
  17. {
  18. use TranslationTrait;
  19. /**
  20. * @ORM\Column(type="string", length=2)
  21. */
  22. protected $locale;
  23. /**
  24. * @Serializer\Groups({"api"})
  25. * @Serializer\SerializedName("name")
  26. * @ORM\Column(type="string", length=255, nullable=true)
  27. */
  28. private $title;
  29. /**
  30. * @Serializer\Groups({"api"})
  31. * @Serializer\SerializedName("title")
  32. * @ORM\Column(type="string", length=255, nullable=true)
  33. */
  34. private $text;
  35. /**
  36. * @Serializer\Groups({"api"})
  37. * @Serializer\SerializedName("url")
  38. * @ORM\Column(type="string", length=255, nullable=true)
  39. */
  40. private $url;
  41. /**
  42. * @Vich\UploadableField(mapping="notification", fileNameProperty="image")
  43. * @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
  44. * @var File|null
  45. */
  46. private $imageFile;
  47. /**
  48. * @Serializer\Groups({"api"})
  49. * @Serializer\SerializedName("image")
  50. * @ORM\Column(type="string", length=255, nullable=true)
  51. */
  52. private $image;
  53. /**
  54. * @ORM\Column(type="datetime", nullable=true)
  55. */
  56. private $editts;
  57. public function getTitle(): ?string
  58. {
  59. return $this->title;
  60. }
  61. public function setTitle(?string $title): self
  62. {
  63. $this->title = $title;
  64. return $this;
  65. }
  66. /**
  67. * @return mixed
  68. */
  69. public function getText()
  70. {
  71. return $this->text;
  72. }
  73. /**
  74. * @param mixed $text
  75. */
  76. public function setText($text): void
  77. {
  78. $this->text = $text;
  79. }
  80. /**
  81. * @return mixed
  82. */
  83. public function getUrl()
  84. {
  85. return $this->url;
  86. }
  87. /**
  88. * @param mixed $url
  89. */
  90. public function setUrl($url): void
  91. {
  92. $this->url = $url;
  93. }
  94. /**
  95. * Get Image1File
  96. *
  97. * @return null|File
  98. */
  99. public function getImageFile(): ?File
  100. {
  101. return $this->imageFile;
  102. }
  103. /**
  104. * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  105. */
  106. public function setImageFile(?File $imageFile = null): void
  107. {
  108. $this->imageFile = $imageFile;
  109. if (null !== $imageFile) {
  110. $this->editts = new \DateTime();
  111. }
  112. }
  113. /**
  114. * @return mixed
  115. */
  116. public function getImage()
  117. {
  118. return $this->image;
  119. }
  120. /**
  121. * @param mixed $image
  122. */
  123. public function setImage($image): void
  124. {
  125. $this->image = $image;
  126. }
  127. /**
  128. * @return mixed
  129. */
  130. public function getEditts()
  131. {
  132. return $this->editts;
  133. }
  134. /**
  135. * @param mixed $editts
  136. */
  137. public function setEditts($editts): void
  138. {
  139. $this->editts = $editts;
  140. }
  141. }