src/Entity/Property.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PropertyRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=PropertyRepository::class)
  9. */
  10. class Property
  11. {
  12. const TYPE_CANDIDATURE = "candidature";
  13. const TYPE_EMPLOYE = "employé";
  14. const TYPE_CUSTOMER = "parent";
  15. const TYPE_POST_CANDIDATURE = "postCandidature";
  16. const TYPE_ENFANT = "enfant" ;
  17. /**
  18. * @ORM\Id
  19. * @ORM\GeneratedValue
  20. * @ORM\Column(type="integer")
  21. */
  22. private $id;
  23. /**
  24. * @ORM\Column(type="string", length=255)
  25. */
  26. private $name;
  27. /**
  28. * @ORM\ManyToOne(targetEntity=Property::class, inversedBy="children")
  29. */
  30. private $parent;
  31. /**
  32. * @ORM\OneToMany(targetEntity=Property::class, mappedBy="parent")
  33. */
  34. private $children;
  35. /**
  36. * @ORM\Column(type="json", nullable=true)
  37. */
  38. private $groupContact = [];
  39. /**
  40. * @ORM\Column(type="boolean", nullable=true)
  41. */
  42. private $isActive;
  43. /**
  44. * @ORM\OneToMany(targetEntity=ContactPropertyValue::class, mappedBy="property")
  45. */
  46. private $contactPropertyValues;
  47. /**
  48. * @ORM\Column(type="string", length=255, nullable=true)
  49. */
  50. private $type;
  51. /**
  52. * @ORM\Column(type="string", length=255, nullable=true)
  53. */
  54. private $comment;
  55. /**
  56. * @ORM\Column(type="string", length=255, nullable=true)
  57. */
  58. private $default;
  59. /**
  60. * @ORM\Column(type="json", nullable=true)
  61. */
  62. private $choices = [];
  63. /**
  64. * @ORM\Column(type="string", length=255, nullable=true)
  65. */
  66. private $factoryType;
  67. /**
  68. * @ORM\ManyToMany(targetEntity=Sejour::class, mappedBy="property")
  69. */
  70. private $sejours;
  71. /**
  72. * @ORM\Column(type="boolean", nullable=true)
  73. */
  74. private $isMandatory;
  75. /**
  76. * @ORM\Column(type="string", length=255, nullable=true)
  77. */
  78. private $subType;
  79. /**
  80. * @ORM\Column(type="string", length=255, nullable=true)
  81. */
  82. private $subSubType;
  83. /**
  84. * @ORM\Column(type="boolean", nullable=true)
  85. */
  86. private $isFactory;
  87. /**
  88. * @ORM\Column(type="string", length=255, nullable=true)
  89. */
  90. private $validationClass;
  91. /**
  92. * @ORM\Column(type="string", length=255, nullable=true)
  93. */
  94. private $postProcess;
  95. /**
  96. * @ORM\Column(type="string", length=255, nullable=true)
  97. */
  98. private $pdfValue;
  99. /**
  100. * @ORM\Column(type="integer", nullable=true)
  101. */
  102. private $position;
  103. public function __construct()
  104. {
  105. $this->children = new ArrayCollection();
  106. $this->contactPropertyValues = new ArrayCollection();
  107. $this->sejours = new ArrayCollection();
  108. $this->isMandatory = false;
  109. }
  110. public function getId(): ?int
  111. {
  112. return $this->id;
  113. }
  114. public function getName(): ?string
  115. {
  116. return $this->name;
  117. }
  118. public function setName(string $name): self
  119. {
  120. $this->name = $name;
  121. return $this;
  122. }
  123. public function getComment(): ?string
  124. {
  125. return $this->comment;
  126. }
  127. public function setComment(string $comment): self
  128. {
  129. $this->comment = $comment;
  130. return $this;
  131. }
  132. public function getValidationClass(): ?string
  133. {
  134. return $this->validationClass;
  135. }
  136. public function setValidationClass(string $validationClass): self
  137. {
  138. $this->validationClass = $validationClass;
  139. return $this;
  140. }
  141. public function getPostProcess(): ?string
  142. {
  143. return $this->postProcess;
  144. }
  145. public function setPostProcess(string $validationClass): self
  146. {
  147. $this->postProcess = $validationClass;
  148. return $this;
  149. }
  150. public function getPdfValue(): ?string
  151. {
  152. return $this->pdfValue;
  153. }
  154. public function setPdfValue(string $validationClass): self
  155. {
  156. $this->pdfValue = $validationClass;
  157. return $this;
  158. }
  159. public function getParent(): ?self
  160. {
  161. return $this->parent;
  162. }
  163. public function setParent(?self $parent): self
  164. {
  165. $this->parent = $parent;
  166. return $this;
  167. }
  168. /**
  169. * @return Collection|self[]
  170. */
  171. public function getChildren(): Collection
  172. {
  173. return $this->children;
  174. }
  175. public function addChild(self $child): self
  176. {
  177. if (!$this->children->contains($child)) {
  178. $this->children[] = $child;
  179. $child->setParent($this);
  180. }
  181. return $this;
  182. }
  183. public function removeChild(self $child): self
  184. {
  185. if ($this->children->removeElement($child)) {
  186. // set the owning side to null (unless already changed)
  187. if ($child->getParent() === $this) {
  188. $child->setParent(null);
  189. }
  190. }
  191. return $this;
  192. }
  193. public function getGroupContact(): ?array
  194. {
  195. return $this->groupContact;
  196. }
  197. public function setGroupContact(?array $groupContact): self
  198. {
  199. $this->groupContact = $groupContact;
  200. return $this;
  201. }
  202. public function getIsActive(): ?bool
  203. {
  204. return $this->isActive;
  205. }
  206. public function setIsActive(?bool $isActive): self
  207. {
  208. $this->isActive = $isActive;
  209. return $this;
  210. }
  211. /**
  212. * @return Collection|ContactPropertyValue[]
  213. */
  214. public function getContactPropertyValues(): Collection
  215. {
  216. return $this->contactPropertyValues;
  217. }
  218. public function addContactPropertyValue(ContactPropertyValue $contactPropertyValue): self
  219. {
  220. if (!$this->contactPropertyValues->contains($contactPropertyValue)) {
  221. $this->contactPropertyValues[] = $contactPropertyValue;
  222. $contactPropertyValue->setProperty($this);
  223. }
  224. return $this;
  225. }
  226. public function removeContactPropertyValue(ContactPropertyValue $contactPropertyValue): self
  227. {
  228. if ($this->contactPropertyValues->removeElement($contactPropertyValue)) {
  229. // set the owning side to null (unless already changed)
  230. if ($contactPropertyValue->getProperty() === $this) {
  231. $contactPropertyValue->setProperty(null);
  232. }
  233. }
  234. return $this;
  235. }
  236. public function getType(): ?string
  237. {
  238. return $this->type;
  239. }
  240. public function setType(?string $type): self
  241. {
  242. $this->type = $type;
  243. return $this;
  244. }
  245. public function getDefault(): ?string
  246. {
  247. return $this->default;
  248. }
  249. public function setDefault(?string $type): self
  250. {
  251. $this->default = $type;
  252. return $this;
  253. }
  254. public function getChoices(): ?array
  255. {
  256. return $this->choices;
  257. }
  258. public function setChoices(?array $choices): self
  259. {
  260. $this->choices = $choices;
  261. return $this;
  262. }
  263. public function getFactoryType(): ?string
  264. {
  265. return $this->factoryType;
  266. }
  267. public function setFactoryType(?string $factoryType): self
  268. {
  269. $this->factoryType = $factoryType;
  270. return $this;
  271. }
  272. /**
  273. * @return Collection|Sejour[]
  274. */
  275. public function getSejours(): Collection
  276. {
  277. return $this->sejours;
  278. }
  279. public function addSejour(Sejour $sejour): self
  280. {
  281. if (!$this->sejours->contains($sejour)) {
  282. $this->sejours[] = $sejour;
  283. $sejour->addProperty($this);
  284. }
  285. return $this;
  286. }
  287. public function removeSejour(Sejour $sejour): self
  288. {
  289. if ($this->sejours->removeElement($sejour)) {
  290. $sejour->removeProperty($this);
  291. }
  292. return $this;
  293. }
  294. public function getIsMandatory(): ?bool
  295. {
  296. return $this->isMandatory;
  297. }
  298. public function setIsMandatory(?bool $isMandatory): self
  299. {
  300. $this->isMandatory = $isMandatory;
  301. return $this;
  302. }
  303. public function getSubType(): ?string
  304. {
  305. return $this->subType;
  306. }
  307. public function setSubType(?string $subType): self
  308. {
  309. $this->subType = $subType;
  310. return $this;
  311. }
  312. public function getSubSubType(): ?string
  313. {
  314. return $this->subSubType;
  315. }
  316. public function setSubSubType(?string $subType): self
  317. {
  318. $this->subSubType = $subType;
  319. return $this;
  320. }
  321. public function getIsFactory(): ?bool
  322. {
  323. return $this->isFactory;
  324. }
  325. public function setIsFactory(?bool $isFactory): self
  326. {
  327. $this->isFactory = $isFactory;
  328. return $this;
  329. }
  330. public function getPosition(): ?int
  331. {
  332. return $this->position;
  333. }
  334. public function setPosition(?int $position): self
  335. {
  336. $this->position = $position;
  337. return $this;
  338. }
  339. }