src/Entity/Web/Career.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Web;
  3. use App\Repository\Web\CareerRepository;
  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_career")
  9. * @ORM\Entity(repositoryClass=CareerRepository::class)
  10. * @ORM\EntityListeners({"App\Listener\EntityListener"})
  11. */
  12. class Career 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="datetime")
  23. */
  24. private $datePublic;
  25. /**
  26. * @ORM\Column(type="string", nullable=false)
  27. */
  28. private $type;
  29. /**
  30. * @ORM\Column(type="string", nullable=false)
  31. */
  32. private $contactName;
  33. /**
  34. * @ORM\Column(type="string", nullable=false)
  35. */
  36. private $email;
  37. /**
  38. * @ORM\Column(type="string", nullable=false)
  39. */
  40. private $phone;
  41. /**
  42. * @ORM\Column(type="boolean")
  43. */
  44. private $isActive;
  45. /**
  46. * @ORM\Column(type="datetime")
  47. */
  48. private $createts;
  49. /**
  50. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  51. * @ORM\JoinColumn(nullable=false)
  52. */
  53. private $createUser;
  54. /**
  55. * @ORM\Column(type="datetime", nullable=true)
  56. */
  57. private $editts;
  58. /**
  59. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  60. */
  61. private $editUser;
  62. /**
  63. * @ORM\ManyToOne(targetEntity="App\Entity\Application\Store", inversedBy="careers")
  64. */
  65. private $store;
  66. public function __construct()
  67. {
  68. $this->setDefaultLocale(\Locale::getDefault());
  69. $trans = new CareerTranslation($this->getDefaultLocale());
  70. $this->addTranslation($trans);
  71. if($this->getDatePublic() === null){$this->setDatePublic(new \DateTime());}
  72. }
  73. public function getId(): ?int
  74. {
  75. return $this->id;
  76. }
  77. /**
  78. * @return mixed
  79. */
  80. public function getDatePublic()
  81. {
  82. return $this->datePublic;
  83. }
  84. /**
  85. * @param mixed $datePublic
  86. */
  87. public function setDatePublic($datePublic): void
  88. {
  89. $this->datePublic = $datePublic;
  90. }
  91. public function isIsActive(): ?bool
  92. {
  93. return $this->isActive;
  94. }
  95. public function setIsActive(bool $isActive): self
  96. {
  97. $this->isActive = $isActive;
  98. return $this;
  99. }
  100. public function __call($method, $arguments)
  101. {
  102. $ret = $this->proxyCurrentLocaleTranslation($method, $arguments);
  103. if(empty($ret)) {
  104. $ret = call_user_func_array( [ $this->translate( \Locale::getDefault() ), $method ], $arguments );
  105. }
  106. return $ret;
  107. }
  108. /**
  109. * @return mixed
  110. */
  111. public function getCreatets()
  112. {
  113. return $this->createts;
  114. }
  115. /**
  116. * @param mixed $createts
  117. */
  118. public function setCreatets($createts): void
  119. {
  120. $this->createts = $createts;
  121. }
  122. /**
  123. * @return mixed
  124. */
  125. public function getCreateUser()
  126. {
  127. return $this->createUser;
  128. }
  129. /**
  130. * @param mixed $createUser
  131. */
  132. public function setCreateUser($createUser): void
  133. {
  134. $this->createUser = $createUser;
  135. }
  136. /**
  137. * @return mixed
  138. */
  139. public function getEditts()
  140. {
  141. return $this->editts;
  142. }
  143. /**
  144. * @param mixed $editts
  145. */
  146. public function setEditts($editts): void
  147. {
  148. $this->editts = $editts;
  149. }
  150. /**
  151. * @return mixed
  152. */
  153. public function getEditUser()
  154. {
  155. return $this->editUser;
  156. }
  157. /**
  158. * @param mixed $editUser
  159. */
  160. public function setEditUser($editUser): void
  161. {
  162. $this->editUser = $editUser;
  163. }
  164. /**
  165. * @return mixed
  166. */
  167. public function getStore()
  168. {
  169. return $this->store;
  170. }
  171. /**
  172. * @param mixed $store
  173. */
  174. public function setStore($store): void
  175. {
  176. $this->store = $store;
  177. }
  178. /**
  179. * @return mixed
  180. */
  181. public function getType()
  182. {
  183. return $this->type;
  184. }
  185. /**
  186. * @param mixed $type
  187. */
  188. public function setType($type): void
  189. {
  190. $this->type = $type;
  191. }
  192. /**
  193. * @return mixed
  194. */
  195. public function getContactName()
  196. {
  197. return $this->contactName;
  198. }
  199. /**
  200. * @param mixed $contactName
  201. */
  202. public function setContactName($contactName): void
  203. {
  204. $this->contactName = $contactName;
  205. }
  206. /**
  207. * @return mixed
  208. */
  209. public function getEmail()
  210. {
  211. return $this->email;
  212. }
  213. /**
  214. * @param mixed $email
  215. */
  216. public function setEmail($email): void
  217. {
  218. $this->email = $email;
  219. }
  220. /**
  221. * @return mixed
  222. */
  223. public function getPhone()
  224. {
  225. return $this->phone;
  226. }
  227. /**
  228. * @param mixed $phone
  229. */
  230. public function setPhone($phone): void
  231. {
  232. $this->phone = $phone;
  233. }
  234. }