src/Entity/Web/Modal.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Web;
  3. use App\Repository\Web\ModalRepository;
  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_modal")
  9. * @ORM\Entity(repositoryClass=ModalRepository::class)
  10. * @ORM\EntityListeners({"App\Listener\EntityListener"})
  11. */
  12. class Modal implements TranslatableInterface
  13. {
  14. use TranslatableTrait;
  15. /**
  16. * @ORM\Id
  17. * @ORM\GeneratedValue
  18. * @ORM\Column(type="integer")
  19. */
  20. private $id;
  21. /**
  22. * @ORM\Column(type="boolean")
  23. */
  24. private $isActive;
  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="datetime")
  35. */
  36. private $createts;
  37. /**
  38. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  39. * @ORM\JoinColumn(nullable=false)
  40. */
  41. private $createUser;
  42. /**
  43. * @ORM\Column(type="datetime", nullable=true)
  44. */
  45. private $editts;
  46. /**
  47. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  48. */
  49. private $editUser;
  50. public function __construct()
  51. {
  52. $this->setDefaultLocale(\Locale::getDefault());
  53. $trans = new ModalTranslation($this->getDefaultLocale());
  54. $this->addTranslation($trans);
  55. if($this->getDateFrom() === null){$this->setDateFrom(new \DateTime());}
  56. if($this->getDateTo() === null){$this->setDateTo(new \DateTime());}
  57. }
  58. public function getId(): ?int
  59. {
  60. return $this->id;
  61. }
  62. public function isIsActive(): ?bool
  63. {
  64. return $this->isActive;
  65. }
  66. public function setIsActive(bool $isActive): self
  67. {
  68. $this->isActive = $isActive;
  69. return $this;
  70. }
  71. public function getDateFrom(): ?\DateTimeInterface
  72. {
  73. return $this->dateFrom;
  74. }
  75. public function setDateFrom($dateFrom): self
  76. {
  77. $this->dateFrom = $dateFrom;
  78. return $this;
  79. }
  80. public function getDateTo(): ?\DateTimeInterface
  81. {
  82. return $this->dateTo;
  83. }
  84. public function setDateTo( $dateTo): self
  85. {
  86. $this->dateTo = $dateTo;
  87. return $this;
  88. }
  89. public function __call($method, $arguments)
  90. {
  91. $ret = $this->proxyCurrentLocaleTranslation($method, $arguments);
  92. if(empty($ret)) {
  93. $ret = call_user_func_array( [ $this->translate( \Locale::getDefault() ), $method ], $arguments );
  94. }
  95. return $ret;
  96. }
  97. /**
  98. * @return mixed
  99. */
  100. public function getCreatets()
  101. {
  102. return $this->createts;
  103. }
  104. /**
  105. * @param mixed $createts
  106. */
  107. public function setCreatets($createts): void
  108. {
  109. $this->createts = $createts;
  110. }
  111. /**
  112. * @return mixed
  113. */
  114. public function getCreateUser()
  115. {
  116. return $this->createUser;
  117. }
  118. /**
  119. * @param mixed $createUser
  120. */
  121. public function setCreateUser($createUser): void
  122. {
  123. $this->createUser = $createUser;
  124. }
  125. /**
  126. * @return mixed
  127. */
  128. public function getEditts()
  129. {
  130. return $this->editts;
  131. }
  132. /**
  133. * @param mixed $editts
  134. */
  135. public function setEditts($editts): void
  136. {
  137. $this->editts = $editts;
  138. }
  139. /**
  140. * @return mixed
  141. */
  142. public function getEditUser()
  143. {
  144. return $this->editUser;
  145. }
  146. /**
  147. * @param mixed $editUser
  148. */
  149. public function setEditUser($editUser): void
  150. {
  151. $this->editUser = $editUser;
  152. }
  153. }