src/Entity/Web/SlideShow.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Web;
  3. use App\Repository\Web\SlideShowRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\Behaviors\TranslatableTrait;
  6. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  7. /**
  8. * @ORM\Table(name="web_slide_show")
  9. * @ORM\Entity(repositoryClass=SlideShowRepository::class)
  10. * @ORM\EntityListeners({"App\Listener\EntityListener"})
  11. */
  12. class SlideShow implements TranslatableInterface
  13. {
  14. use TranslatableTrait;
  15. /**
  16. * @ORM\Id
  17. * @ORM\GeneratedValue
  18. * @ORM\Column(type="integer")
  19. */
  20. private int $id;
  21. /**
  22. * @ORM\Column(type="string", length=255)
  23. */
  24. private string $name;
  25. /**
  26. * @ORM\Column(type="datetime")
  27. */
  28. private $dateFrom;
  29. /**
  30. * @ORM\Column(type="datetime")
  31. */
  32. private $dateTo;
  33. /**
  34. * @ORM\Column(type="boolean")
  35. */
  36. private $isActive;
  37. /**
  38. * @ORM\Column(type="integer")
  39. */
  40. private $position;
  41. /**
  42. * @ORM\Column(type="datetime")
  43. */
  44. private $createts;
  45. /**
  46. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  47. * @ORM\JoinColumn(nullable=false)
  48. */
  49. private $createUser;
  50. /**
  51. * @ORM\Column(type="datetime", nullable=true)
  52. */
  53. private $editts;
  54. /**
  55. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  56. */
  57. private $editUser;
  58. public function __construct()
  59. {
  60. $this->setDefaultLocale(\Locale::getDefault());
  61. $trans = new SlideShowTranslation($this->getDefaultLocale());
  62. $this->addTranslation($trans);
  63. if($this->getDateFrom() === null){$this->setDateFrom(new \DateTime());}
  64. if($this->getDateTo() === null){$this->setDateTo(new \DateTime());}
  65. }
  66. public function getId(): ?int
  67. {
  68. return $this->id;
  69. }
  70. public function getName(): ?string
  71. {
  72. return $this->name;
  73. }
  74. public function setName(string $name): self
  75. {
  76. $this->name = $name;
  77. return $this;
  78. }
  79. public function getDateFrom(): ?\DateTimeInterface
  80. {
  81. return $this->dateFrom;
  82. }
  83. public function setDateFrom($dateFrom): self
  84. {
  85. $this->dateFrom = $dateFrom;
  86. return $this;
  87. }
  88. public function getDateTo(): ?\DateTimeInterface
  89. {
  90. return $this->dateTo;
  91. }
  92. public function setDateTo( $dateTo): self
  93. {
  94. $this->dateTo = $dateTo;
  95. return $this;
  96. }
  97. public function isIsActive(): ?bool
  98. {
  99. return $this->isActive;
  100. }
  101. public function setIsActive(bool $isActive): self
  102. {
  103. $this->isActive = $isActive;
  104. return $this;
  105. }
  106. public function __call($method, $arguments)
  107. {
  108. $ret = $this->proxyCurrentLocaleTranslation($method, $arguments);
  109. if(empty($ret)) {
  110. $ret = call_user_func_array( [ $this->translate( \Locale::getDefault() ), $method ], $arguments );
  111. }
  112. return $ret;
  113. }
  114. /**
  115. * @return mixed
  116. */
  117. public function getPosition()
  118. {
  119. return $this->position;
  120. }
  121. /**
  122. * @param mixed $position
  123. */
  124. public function setPosition($position): void
  125. {
  126. $this->position = $position;
  127. }
  128. /**
  129. * @return mixed
  130. */
  131. public function getCreatets()
  132. {
  133. return $this->createts;
  134. }
  135. /**
  136. * @param mixed $createts
  137. */
  138. public function setCreatets($createts): void
  139. {
  140. $this->createts = $createts;
  141. }
  142. /**
  143. * @return mixed
  144. */
  145. public function getCreateUser()
  146. {
  147. return $this->createUser;
  148. }
  149. /**
  150. * @param mixed $createUser
  151. */
  152. public function setCreateUser($createUser): void
  153. {
  154. $this->createUser = $createUser;
  155. }
  156. /**
  157. * @return mixed
  158. */
  159. public function getEditts()
  160. {
  161. return $this->editts;
  162. }
  163. /**
  164. * @param mixed $editts
  165. */
  166. public function setEditts($editts): void
  167. {
  168. $this->editts = $editts;
  169. }
  170. /**
  171. * @return mixed
  172. */
  173. public function getEditUser()
  174. {
  175. return $this->editUser;
  176. }
  177. /**
  178. * @param mixed $editUser
  179. */
  180. public function setEditUser($editUser): void
  181. {
  182. $this->editUser = $editUser;
  183. }
  184. }