AccessWish.php 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306
  1. <?php
  2. namespace AppBundle\Entity\AccessWish;
  3. use AppBundle\Annotation\DefaultField;
  4. use AppBundle\Annotation\ExportSplitFields;
  5. use AppBundle\Entity\AccessAndFunction\Access;
  6. use AppBundle\Entity\Core\Country;
  7. use AppBundle\Entity\Core\File;
  8. use AppBundle\Entity\Core\Tagg;
  9. use AppBundle\Entity\Organization\Organization;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use DoctrineExtensions\Query\Mysql\Date;
  13. use Dunglas\ApiBundle\Annotation\Iri;
  14. use libphonenumber\PhoneNumberUtil;
  15. use Symfony\Component\Serializer\Annotation\Groups;
  16. use Symfony\Component\Validator\Constraints as Assert;
  17. use AppBundle\Entity\Traits\TimestampableEntity;
  18. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  19. use Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber as AssertPhoneNumber;
  20. use AppBundle\Validator\Constraints as OpentalentAssert;
  21. /**
  22. * Access.
  23. *
  24. * @see http://schema.org/Access Documentation on Schema.org
  25. *
  26. * @Iri("http://schema.org/AccessWish")
  27. */
  28. #[ORM\Entity(repositoryClass: 'AppBundle\Entity\AccessWish\Repository\AccessWishRepository')]
  29. class AccessWish
  30. {
  31. use TimestampableEntity;
  32. use CreatorUpdaterEntity;
  33. /**
  34. * @var int
  35. */
  36. #[ORM\Column(type: 'integer')]
  37. #[ORM\Id]
  38. #[ORM\GeneratedValue(strategy: 'AUTO')]
  39. #[Groups(['accesswish', 'education_student_wish_list', 'online_registration_access_details', 'online_registration_access_family', 'online_registration_validation_access_family', 'online_registration_validation', 'accesswish_mail'])]
  40. private $id;
  41. /**
  42. * @var Organization
  43. *
  44. * @DefaultField
  45. */
  46. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization')]
  47. #[ORM\JoinColumn(nullable: false)]
  48. #[Assert\NotNull]
  49. #[Groups(['accesswish'])]
  50. private $organization;
  51. /**
  52. * @var Access
  53. */
  54. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'accessWishes', cascade: ['persist'])]
  55. #[ORM\JoinColumn(onDelete: 'CASCADE')]
  56. #[Groups(['accesswish', 'online_registration_access_family_accesswishes', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations', 'online_registration_validation'])]
  57. private $accessOriginal;
  58. /**
  59. * @var AccessFamilyWish
  60. */
  61. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessWish\AccessFamilyWish', inversedBy: 'accessWishes')]
  62. #[Groups(['accesswish_accessfamilywish', 'online_registration_access_family_accesswishes', 'online_registration_validation_access_family_accesswish', 'online_registration_validation_access_family_accesswishreregistrations', 'accesswish_mail', 'education_student_wish_list_accesswishreregistrations', 'education_student_wish_list_accesswish'])]
  63. private $accessFamilyWish;
  64. /**
  65. * @var string
  66. */
  67. #[ORM\Column(type: 'string', nullable: true)]
  68. #[Assert\Type(type: 'string')]
  69. #[Assert\Choice(callback: ['\AppBundle\Enum\OnlineRegistration\StatusEnum', 'toArray'], message: 'invalid-choice')]
  70. #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'accesswish_mail_accessfamilywish'])]
  71. private $status;
  72. /**
  73. * @var bool
  74. */
  75. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  76. #[Assert\Type(type: 'boolean')]
  77. #[Assert\NotNull]
  78. #[Groups(['accesswish', 'online_registration'])]
  79. private $isNewMemberFamily = false;
  80. /**
  81. * @var string
  82. *
  83. * @Iri("https://schema.org/givenName")
  84. */
  85. #[ORM\Column(type: 'string', length: 50, nullable: true)]
  86. #[Assert\Type(type: 'string')]
  87. #[Assert\Length(max: 50, maxMessage: 'invalid-max-length')]
  88. #[Groups(['accesswish', 'online_registration', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations', 'online_registration_validation', 'education_student_wish_list_accesswishreregistrations'])]
  89. private $givenName;
  90. /**
  91. * @var string
  92. *
  93. * @Iri("https://schema.org/name")
  94. */
  95. #[ORM\Column(type: 'string', length: 100, nullable: true)]
  96. #[Assert\Type(type: 'string')]
  97. #[Assert\Length(max: 100, maxMessage: 'invalid-max-length')]
  98. #[Groups(['accesswish', 'online_registration', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations', 'online_registration_validation', 'education_student_wish_list_accesswishreregistrations'])]
  99. private $name;
  100. /**
  101. * @var File
  102. *
  103. * @Iri("https://schema.org/image")
  104. */
  105. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Core\File')]
  106. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  107. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  108. private $image;
  109. /**
  110. * @var \DateTime Date of birth.
  111. *
  112. * @Iri("https://schema.org/birthDate")
  113. */
  114. #[ORM\Column(type: 'date', nullable: true)]
  115. #[Assert\Date(message: 'invalid-date')]
  116. #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
  117. private $birthDate;
  118. /**
  119. * @var int
  120. */
  121. #[Groups(['template', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
  122. protected $ageTemplate;
  123. /**
  124. * @var string Gender of the person.
  125. */
  126. #[ORM\Column(type: 'string', nullable: true)]
  127. #[Assert\Type(type: 'string')]
  128. #[Assert\Choice(callback: ['\AppBundle\Enum\Person\GenderEnum', 'toArray'], message: 'invalid-choice')]
  129. #[Groups(['accesswish', 'online_registration', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations', 'online_registration_validation'])]
  130. private $genderEnum;
  131. /**
  132. * @var string Email address.
  133. *
  134. * @Iri("https://schema.org/email")
  135. */
  136. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  137. #[Assert\Email(strict: true, message: 'invalid-email-format')]
  138. #[Assert\Email(checkMX: true, message: 'invalid-email-domain')]
  139. #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'accesswish_mail', 'accesswish_mail_accessfamilywish', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
  140. private $email;
  141. /**
  142. * @var string
  143. *
  144. * @AssertPhoneNumber
  145. */
  146. #[ORM\Column(type: 'phone_number', nullable: true)]
  147. #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
  148. private $telphone;
  149. /**
  150. * @var string
  151. *
  152. * @AssertPhoneNumber
  153. */
  154. #[ORM\Column(type: 'phone_number', nullable: true)]
  155. #[Groups(['accesswish', 'online_registration', 'online_registration_validation', 'education_student_wish_list_accesswish', 'education_student_wish_list_accesswishreregistrations'])]
  156. private $mobilPhone;
  157. /**
  158. * @var Country
  159. */
  160. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Core\Country')]
  161. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  162. private $addressCountry;
  163. /**
  164. * @var string
  165. */
  166. #[ORM\Column(type: 'string', length: 100, nullable: true)]
  167. #[Assert\Type(type: 'string')]
  168. #[Assert\Length(max: 100, maxMessage: 'invalid-max-length')]
  169. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  170. private $addressCity;
  171. /**
  172. * @var string
  173. *
  174. * @OpentalentAssert\PostalCode
  175. */
  176. #[ORM\Column(type: 'string', length: 20, nullable: true)]
  177. #[Assert\Type(type: 'string')]
  178. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  179. private $postalCode;
  180. /**
  181. * @var string
  182. */
  183. #[ORM\Column(type: 'string', nullable: true)]
  184. #[Assert\Type(type: 'string')]
  185. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  186. private $streetAddress;
  187. /**
  188. * @var string
  189. */
  190. #[ORM\Column(type: 'string', nullable: true)]
  191. #[Assert\Type(type: 'string')]
  192. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  193. private $streetAddressSecond;
  194. /**
  195. * @var string
  196. */
  197. #[ORM\Column(type: 'string', nullable: true)]
  198. #[Assert\Type(type: 'string')]
  199. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  200. private $streetAddressThird;
  201. /**
  202. * @var ArrayCollection<EducationStudentWish>
  203. */
  204. #[Assert\Valid]
  205. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\AccessWish\EducationStudentWish', mappedBy: 'accessWish', cascade: ['persist'], orphanRemoval: true)]
  206. #[Groups(['accesswish_educationstudentwish', 'online_registration', 'online_registration_validation'])]
  207. private $educationStudentWishes;
  208. /**
  209. * @var ArrayCollection<EducationStudentWish>
  210. */
  211. #[Assert\Valid]
  212. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\AccessWish\EducationStudentWish', mappedBy: 'accessWishReregistrations', cascade: ['persist'], orphanRemoval: true)]
  213. #[Groups(['accesswish_educationstudentwish', 'online_registration', 'online_registration_validation'])]
  214. private $educationStudentReregistrationsWishes;
  215. /**
  216. * @var string
  217. */
  218. #[ORM\Column(type: 'string', nullable: true)]
  219. #[Assert\Type(type: 'string')]
  220. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  221. private $profession;
  222. /**
  223. * @var bool
  224. */
  225. #[ORM\Column(type: 'boolean', options: ['default' => true])]
  226. #[Assert\Type(type: 'boolean')]
  227. #[Assert\NotNull]
  228. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  229. private $imageRight = true;
  230. /**
  231. * @var string
  232. */
  233. #[ORM\Column(type: 'text', nullable: true)]
  234. #[Assert\Type(type: 'string')]
  235. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  236. private $medicalComments;
  237. /**
  238. * @var string
  239. */
  240. #[ORM\Column(type: 'text', nullable: true)]
  241. #[Assert\Type(type: 'string')]
  242. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  243. private $notes;
  244. /**
  245. * @var string
  246. */
  247. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  248. #[Assert\Type(type: 'string')]
  249. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  250. private $establishmentName;
  251. /**
  252. * @var string
  253. */
  254. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  255. #[Assert\Type(type: 'string')]
  256. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  257. private $cityName;
  258. /**
  259. * @var string
  260. */
  261. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  262. #[Assert\Type(type: 'string')]
  263. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  264. private $disponibility;
  265. /**
  266. * @var string
  267. */
  268. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  269. #[Assert\Type(type: 'string')]
  270. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  271. private $className;
  272. /**
  273. * @var string
  274. */
  275. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  276. #[Assert\Type(type: 'string')]
  277. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  278. private $teacherName;
  279. /**
  280. * @var ArrayCollection<EducationStudentWish>
  281. */
  282. #[Assert\Valid]
  283. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\AccessWish\DocumentWish', mappedBy: 'accessWish', cascade: ['persist'])]
  284. #[Groups(['accesswish_documentwish', 'online_registration', 'online_registration_validation'])]
  285. private $documentWishes;
  286. /**
  287. * @var string
  288. *
  289. * @ExportSplitFields({"name","givenName"})
  290. */
  291. #[Groups(['accesswish'])]
  292. private $fullNameTemplate;
  293. /**
  294. * @var bool
  295. */
  296. #[ORM\Column(type: 'boolean', options: ['default' => true])]
  297. #[Assert\Type(type: 'boolean')]
  298. #[Assert\NotNull]
  299. private $synchro = false;
  300. /**
  301. * @var bool
  302. */
  303. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  304. #[Assert\Type(type: 'boolean')]
  305. #[Assert\NotNull]
  306. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  307. private $approveRulesProcedureWish = false;
  308. /**
  309. * @var bool
  310. */
  311. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  312. #[Assert\Type(type: 'boolean')]
  313. #[Assert\NotNull]
  314. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  315. private $receiveInformationsFromOrganizationWish = false;
  316. /**
  317. * @var ArrayCollection<Tagg>
  318. */
  319. #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Core\Tagg', cascade: ['persist'], inversedBy: 'accessWishes')]
  320. #[Assert\Valid]
  321. #[ORM\JoinTable(name: 'tag_accessWish', joinColumns: [], inverseJoinColumns: [])]
  322. #[ORM\JoinColumn(name: 'accessWish_id', referencedColumnName: 'id')]
  323. #[ORM\JoinColumn(name: 'tag_id', referencedColumnName: 'id')]
  324. #[Groups(['accesswish_tags', 'manage_tags'])]
  325. private $tags;
  326. /**
  327. * @var string
  328. */
  329. #[ORM\Column(type: 'string', options: ['default' => 'OPEN'])]
  330. #[Assert\Type(type: 'string')]
  331. #[Assert\Choice(callback: ['\AppBundle\Enum\OnlineRegistration\ValidationStateEnum', 'toArray'], message: 'invalid-choice')]
  332. #[Groups(['accesswish', 'online_registration_validation'])]
  333. private $validationState = "OPEN";
  334. /**
  335. * @var bool
  336. */
  337. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  338. #[Assert\Type(type: 'boolean')]
  339. #[Assert\NotNull]
  340. #[Groups(['accesswish', 'online_registration', 'online_registration_validation'])]
  341. private $isValidated = false;
  342. /**
  343. * @var string
  344. * @ExportSplitFields({"gender","name","givenName","email","telphone","mobilPhone","addressCity","postalCode","streetAddress"})
  345. */
  346. #[Groups(['education_student_wish_list_accesswishreregistrations', 'education_student_wish_list_accesswish'])]
  347. private $fullNameAndContactTemplate;
  348. public function __construct()
  349. {
  350. $this->educationStudentWishes = new ArrayCollection();
  351. $this->educationStudentReregistrationsWishes = new ArrayCollection();
  352. $this->documentWishes = new ArrayCollection();
  353. $this->tags = new ArrayCollection();
  354. }
  355. /**
  356. * Sets id.
  357. *
  358. * @param int $id
  359. *
  360. * @return $this
  361. */
  362. public function setId($id)
  363. {
  364. $this->id = $id;
  365. return $this;
  366. }
  367. /**
  368. * Get id
  369. *
  370. * @return integer
  371. */
  372. public function getId()
  373. {
  374. return $this->id;
  375. }
  376. /**
  377. * Set organization
  378. *
  379. * @param \AppBundle\Entity\Organization\Organization $organization
  380. *
  381. * @return AccessWish
  382. */
  383. public function setOrganization(\AppBundle\Entity\Organization\Organization $organization)
  384. {
  385. $this->organization = $organization;
  386. return $this;
  387. }
  388. /**
  389. * Get organization
  390. *
  391. * @return \AppBundle\Entity\Organization\Organization
  392. */
  393. public function getOrganization()
  394. {
  395. return $this->organization;
  396. }
  397. /**
  398. * Set givenName
  399. *
  400. * @param string $givenName
  401. *
  402. * @return AccessWish
  403. */
  404. public function setGivenName($givenName)
  405. {
  406. $this->givenName = $givenName;
  407. return $this;
  408. }
  409. /**
  410. * Get givenName
  411. *
  412. * @return string
  413. */
  414. public function getGivenName()
  415. {
  416. return $this->givenName;
  417. }
  418. /**
  419. * Sets name.
  420. *
  421. * @param string $name
  422. *
  423. * @return $this
  424. */
  425. public function setName($name)
  426. {
  427. $this->name = strtoupper($name);
  428. return $this;
  429. }
  430. /**
  431. * Get name
  432. *
  433. * @return string
  434. */
  435. public function getName()
  436. {
  437. return $this->name;
  438. }
  439. /**
  440. * Set birthDate
  441. *
  442. * @param \DateTime $birthDate
  443. *
  444. * @return AccessWish
  445. */
  446. public function setBirthDate($birthDate)
  447. {
  448. $this->birthDate = $birthDate;
  449. return $this;
  450. }
  451. /**
  452. * Get birthDate
  453. *
  454. * @return \DateTime
  455. */
  456. public function getBirthDate()
  457. {
  458. return $this->birthDate ? $this->birthDate->format('Y-m-d') : $this->birthDate;
  459. }
  460. /**
  461. * Set genderEnum
  462. *
  463. * @param string $genderEnum
  464. *
  465. * @return AccessWish
  466. */
  467. public function setGenderEnum($genderEnum)
  468. {
  469. $this->genderEnum = $genderEnum;
  470. return $this;
  471. }
  472. /**
  473. * Get genderEnum
  474. *
  475. * @return string
  476. */
  477. public function getGenderEnum()
  478. {
  479. return $this->genderEnum;
  480. }
  481. /**
  482. * Set email
  483. *
  484. * @param string $email
  485. *
  486. * @return AccessWish
  487. */
  488. public function setEmail($email)
  489. {
  490. $this->email = $email;
  491. return $this;
  492. }
  493. /**
  494. * Get email
  495. *
  496. * @return string
  497. */
  498. public function getEmail()
  499. {
  500. return $this->email;
  501. }
  502. /**
  503. * Sets telphone.
  504. *
  505. * @param string $telphone
  506. *
  507. * @return $this
  508. */
  509. public function setTelphone($telphone)
  510. {
  511. if(empty($telphone))$telphone = null;
  512. if(is_null($telphone)) $this->telphone = $telphone;
  513. else{
  514. $phoneUtil = PhoneNumberUtil::getInstance();
  515. $phoneNumber = $phoneUtil->parse($telphone, PhoneNumberUtil::UNKNOWN_REGION);
  516. $this->telphone = $phoneNumber;
  517. }
  518. return $this;
  519. }
  520. public function setPhoneNumberTelphone($phoneNumberTelphone)
  521. {
  522. $this->telphone = $phoneNumberTelphone;
  523. }
  524. /**
  525. * Get telphone
  526. *
  527. * @return phone_number
  528. */
  529. public function getTelphone()
  530. {
  531. return $this->telphone;
  532. }
  533. /**
  534. * Sets mobilPhone.
  535. *
  536. * @param string $mobilPhone
  537. *
  538. * @return $this
  539. */
  540. public function setMobilPhone($mobilPhone)
  541. {
  542. if(empty($mobilPhone))$mobilPhone = null;
  543. if(is_null($mobilPhone)) $this->mobilPhone = $mobilPhone;
  544. else{
  545. $phoneUtil = PhoneNumberUtil::getInstance();
  546. $phoneNumber = $phoneUtil->parse($mobilPhone, PhoneNumberUtil::UNKNOWN_REGION);
  547. $this->mobilPhone = $phoneNumber;
  548. }
  549. return $this;
  550. }
  551. public function setPhoneNumberMobilPhone($phoneNumberMobilPhone){
  552. $this->mobilPhone = $phoneNumberMobilPhone;
  553. }
  554. /**
  555. * Get mobilPhone
  556. *
  557. * @return phone_number
  558. */
  559. public function getMobilPhone()
  560. {
  561. return $this->mobilPhone;
  562. }
  563. /**
  564. * Set addressCity
  565. *
  566. * @param string $addressCity
  567. *
  568. * @return AccessWish
  569. */
  570. public function setAddressCity($addressCity)
  571. {
  572. $this->addressCity = $addressCity;
  573. return $this;
  574. }
  575. /**
  576. * Get addressCity
  577. *
  578. * @return string
  579. */
  580. public function getAddressCity()
  581. {
  582. return $this->addressCity;
  583. }
  584. /**
  585. * Set postalCode
  586. *
  587. * @param string $postalCode
  588. *
  589. * @return AccessWish
  590. */
  591. public function setPostalCode($postalCode)
  592. {
  593. $this->postalCode = $postalCode;
  594. return $this;
  595. }
  596. /**
  597. * Get postalCode
  598. *
  599. * @return string
  600. */
  601. public function getPostalCode()
  602. {
  603. return $this->postalCode;
  604. }
  605. /**
  606. * Set streetAddress
  607. *
  608. * @param string $streetAddress
  609. *
  610. * @return AccessWish
  611. */
  612. public function setStreetAddress($streetAddress)
  613. {
  614. $this->streetAddress = $streetAddress;
  615. return $this;
  616. }
  617. /**
  618. * Get streetAddress
  619. *
  620. * @return string
  621. */
  622. public function getStreetAddress()
  623. {
  624. return $this->streetAddress;
  625. }
  626. /**
  627. * Set streetAddressSecond
  628. *
  629. * @param string $streetAddressSecond
  630. *
  631. * @return AccessWish
  632. */
  633. public function setStreetAddressSecond($streetAddressSecond)
  634. {
  635. $this->streetAddressSecond = $streetAddressSecond;
  636. return $this;
  637. }
  638. /**
  639. * Get streetAddressSecond
  640. *
  641. * @return string
  642. */
  643. public function getStreetAddressSecond()
  644. {
  645. return $this->streetAddressSecond;
  646. }
  647. /**
  648. * Set streetAddressThird
  649. *
  650. * @param string $streetAddressThird
  651. *
  652. * @return AccessWish
  653. */
  654. public function setStreetAddressThird($streetAddressThird)
  655. {
  656. $this->streetAddressThird = $streetAddressThird;
  657. return $this;
  658. }
  659. /**
  660. * Get streetAddressThird
  661. *
  662. * @return string
  663. */
  664. public function getStreetAddressThird()
  665. {
  666. return $this->streetAddressThird;
  667. }
  668. /**
  669. * Set image
  670. *
  671. * @param \AppBundle\Entity\Core\File $image
  672. *
  673. * @return AccessWish
  674. */
  675. public function setImage(\AppBundle\Entity\Core\File $image = null)
  676. {
  677. $this->image = $image;
  678. return $this;
  679. }
  680. /**
  681. * Get image
  682. *
  683. * @return \AppBundle\Entity\Core\File
  684. */
  685. public function getImage()
  686. {
  687. return $this->image;
  688. }
  689. /**
  690. * Set addressCountry
  691. *
  692. * @param \AppBundle\Entity\Core\Country $addressCountry
  693. *
  694. * @return AccessWish
  695. */
  696. public function setAddressCountry(\AppBundle\Entity\Core\Country $addressCountry = null)
  697. {
  698. $this->addressCountry = $addressCountry;
  699. return $this;
  700. }
  701. /**
  702. * Get addressCountry
  703. *
  704. * @return \AppBundle\Entity\AccessWish\Country
  705. */
  706. public function getAddressCountry()
  707. {
  708. return $this->addressCountry;
  709. }
  710. /**
  711. * Add educationStudentWish
  712. *
  713. * @param \AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentWish
  714. *
  715. * @return AccessWish
  716. */
  717. public function addEducationStudentWish(\AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentWish)
  718. {
  719. $educationStudentWish->setAccessWish($this);
  720. $this->educationStudentWishes[] = $educationStudentWish;
  721. return $this;
  722. }
  723. /**
  724. * Remove educationStudentWish
  725. *
  726. * @param \AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentWish
  727. */
  728. public function removeEducationStudentWish(\AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentWish)
  729. {
  730. $this->educationStudentWishes->removeElement($educationStudentWish);
  731. }
  732. /**
  733. * Get educationStudentWishes
  734. *
  735. * @return \Doctrine\Common\Collections\Collection
  736. */
  737. public function getEducationStudentWishes()
  738. {
  739. return $this->educationStudentWishes;
  740. }
  741. /**
  742. * Set imageRight
  743. *
  744. * @param boolean $imageRight
  745. *
  746. * @return AccessWish
  747. */
  748. public function setImageRight($imageRight)
  749. {
  750. $this->imageRight = $imageRight;
  751. return $this;
  752. }
  753. /**
  754. * Get imageRight
  755. *
  756. * @return boolean
  757. */
  758. public function getImageRight()
  759. {
  760. return $this->imageRight;
  761. }
  762. /**
  763. * Set medicalComments
  764. *
  765. * @param string $medicalComments
  766. *
  767. * @return AccessWish
  768. */
  769. public function setMedicalComments($medicalComments)
  770. {
  771. $this->medicalComments = $medicalComments;
  772. return $this;
  773. }
  774. /**
  775. * Get medicalComments
  776. *
  777. * @return string
  778. */
  779. public function getMedicalComments()
  780. {
  781. return $this->medicalComments;
  782. }
  783. /**
  784. * Set notes
  785. *
  786. * @param string $notes
  787. *
  788. * @return AccessWish
  789. */
  790. public function setNotes($notes)
  791. {
  792. $this->notes = $notes;
  793. return $this;
  794. }
  795. /**
  796. * Get notes
  797. *
  798. * @return string
  799. */
  800. public function getNotes()
  801. {
  802. return $this->notes;
  803. }
  804. /**
  805. * Set profession
  806. *
  807. * @param string $profession
  808. *
  809. * @return AccessWish
  810. */
  811. public function setProfession($profession)
  812. {
  813. $this->profession = $profession;
  814. return $this;
  815. }
  816. /**
  817. * Get profession
  818. *
  819. * @return string
  820. */
  821. public function getProfession()
  822. {
  823. return $this->profession;
  824. }
  825. /**
  826. * Set establishmentName
  827. *
  828. * @param string $establishmentName
  829. *
  830. * @return AccessWish
  831. */
  832. public function setEstablishmentName($establishmentName)
  833. {
  834. $this->establishmentName = $establishmentName;
  835. return $this;
  836. }
  837. /**
  838. * Get establishmentName
  839. *
  840. * @return string
  841. */
  842. public function getEstablishmentName()
  843. {
  844. return $this->establishmentName;
  845. }
  846. /**
  847. * Set cityName
  848. *
  849. * @param string $cityName
  850. *
  851. * @return AccessWish
  852. */
  853. public function setCityName($cityName)
  854. {
  855. $this->cityName = $cityName;
  856. return $this;
  857. }
  858. /**
  859. * Get cityName
  860. *
  861. * @return string
  862. */
  863. public function getCityName()
  864. {
  865. return $this->cityName;
  866. }
  867. /**
  868. * Set disponibility
  869. *
  870. * @param string $disponibility
  871. *
  872. * @return AccessWish
  873. */
  874. public function setDisponibility($disponibility)
  875. {
  876. $this->disponibility = $disponibility;
  877. return $this;
  878. }
  879. /**
  880. * Get disponibility
  881. *
  882. * @return string
  883. */
  884. public function getDisponibility()
  885. {
  886. return $this->disponibility;
  887. }
  888. /**
  889. * Set className
  890. *
  891. * @param string $className
  892. *
  893. * @return AccessWish
  894. */
  895. public function setClassName($className)
  896. {
  897. $this->className = $className;
  898. return $this;
  899. }
  900. /**
  901. * Get className
  902. *
  903. * @return string
  904. */
  905. public function getClassName()
  906. {
  907. return $this->className;
  908. }
  909. /**
  910. * Set teacherName
  911. *
  912. * @param string $teacherName
  913. *
  914. * @return AccessWish
  915. */
  916. public function setTeacherName($teacherName)
  917. {
  918. $this->teacherName = $teacherName;
  919. return $this;
  920. }
  921. /**
  922. * Get teacher
  923. *
  924. * @return string
  925. */
  926. public function getTeacherName()
  927. {
  928. return $this->teacherName;
  929. }
  930. /**
  931. * Add documentWish
  932. *
  933. * @param \AppBundle\Entity\AccessWish\DocumentWish $documentWish
  934. *
  935. * @return AccessWish
  936. */
  937. public function addDocumentWish(\AppBundle\Entity\AccessWish\DocumentWish $documentWish)
  938. {
  939. $documentWish->setAccessWish($this);
  940. $this->documentWishes[] = $documentWish;
  941. return $this;
  942. }
  943. /**
  944. * Remove documentWish
  945. *
  946. * @param \AppBundle\Entity\AccessWish\DocumentWish $documentWish
  947. */
  948. public function removeDocumentWish(\AppBundle\Entity\AccessWish\DocumentWish $documentWish)
  949. {
  950. $this->documentWishes->removeElement($documentWish);
  951. }
  952. /**
  953. * Get documentWishes
  954. *
  955. * @return \Doctrine\Common\Collections\Collection
  956. */
  957. public function getDocumentWishes()
  958. {
  959. return $this->documentWishes;
  960. }
  961. /**
  962. * Gets full name.
  963. *
  964. * @return string
  965. */
  966. public function getFullNameTemplate()
  967. {
  968. return $this->getName() . ' ' . $this->getGivenName();
  969. }
  970. /**
  971. * Set accessOriginal
  972. *
  973. * @param \AppBundle\Entity\AccessAndFunction\Access $accessOriginal
  974. *
  975. * @return AccessWish
  976. */
  977. public function setAccessOriginal(\AppBundle\Entity\AccessAndFunction\Access $accessOriginal = null)
  978. {
  979. $this->accessOriginal = $accessOriginal;
  980. return $this;
  981. }
  982. /**
  983. * Get accessOriginal
  984. *
  985. * @return \AppBundle\Entity\AccessAndFunction\Access
  986. */
  987. public function getAccessOriginal()
  988. {
  989. return $this->accessOriginal;
  990. }
  991. /**
  992. * Set accessFamilyWish
  993. *
  994. * @param \AppBundle\Entity\AccessWish\AccessFamilyWish $accessFamilyWish
  995. *
  996. * @return AccessWish
  997. */
  998. public function setAccessFamilyWish(\AppBundle\Entity\AccessWish\AccessFamilyWish $accessFamilyWish = null)
  999. {
  1000. $this->accessFamilyWish = $accessFamilyWish;
  1001. return $this;
  1002. }
  1003. /**
  1004. * Get accessFamilyWish
  1005. *
  1006. * @return \AppBundle\Entity\AccessWish\AccessFamilyWish
  1007. */
  1008. public function getAccessFamilyWish()
  1009. {
  1010. return $this->accessFamilyWish;
  1011. }
  1012. /**
  1013. * Set status
  1014. *
  1015. * @param string $status
  1016. *
  1017. * @return AccessWish
  1018. */
  1019. public function setStatus($status)
  1020. {
  1021. $this->status = $status;
  1022. return $this;
  1023. }
  1024. /**
  1025. * Get status
  1026. *
  1027. * @return string
  1028. */
  1029. public function getStatus()
  1030. {
  1031. return $this->status;
  1032. }
  1033. /**
  1034. * Add educationStudentReregistrationsWish
  1035. *
  1036. * @param \AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentReregistrationsWish
  1037. *
  1038. * @return AccessWish
  1039. */
  1040. public function addEducationStudentReregistrationsWish(\AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentReregistrationsWish)
  1041. {
  1042. $educationStudentReregistrationsWish->setAccessWishReregistrations($this);
  1043. $this->educationStudentReregistrationsWishes[] = $educationStudentReregistrationsWish;
  1044. return $this;
  1045. }
  1046. /**
  1047. * Remove educationStudentReregistrationsWish
  1048. *
  1049. * @param \AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentReregistrationsWish
  1050. */
  1051. public function removeEducationStudentReregistrationsWish(\AppBundle\Entity\AccessWish\EducationStudentWish $educationStudentReregistrationsWish)
  1052. {
  1053. $this->educationStudentReregistrationsWishes->removeElement($educationStudentReregistrationsWish);
  1054. }
  1055. /**
  1056. * Get educationStudentReregistrationsWishes
  1057. *
  1058. * @return \Doctrine\Common\Collections\Collection
  1059. */
  1060. public function getEducationStudentReregistrationsWishes()
  1061. {
  1062. return $this->educationStudentReregistrationsWishes;
  1063. }
  1064. /**
  1065. * Set synchro
  1066. *
  1067. * @param boolean $synchro
  1068. *
  1069. * @return AccessWish
  1070. */
  1071. public function setSynchro($synchro)
  1072. {
  1073. $this->synchro = $synchro;
  1074. return $this;
  1075. }
  1076. /**
  1077. * Get synchro
  1078. *
  1079. * @return boolean
  1080. */
  1081. public function getSynchro()
  1082. {
  1083. return $this->synchro;
  1084. }
  1085. /**
  1086. * Set approveRulesProcedureWish
  1087. *
  1088. * @param boolean $approveRulesProcedureWish
  1089. *
  1090. * @return AccessWish
  1091. */
  1092. public function setApproveRulesProcedureWish($approveRulesProcedureWish)
  1093. {
  1094. $this->approveRulesProcedureWish = $approveRulesProcedureWish;
  1095. return $this;
  1096. }
  1097. /**
  1098. * Get approveRulesProcedureWish
  1099. *
  1100. * @return boolean
  1101. */
  1102. public function getApproveRulesProcedureWish()
  1103. {
  1104. return $this->approveRulesProcedureWish;
  1105. }
  1106. /**
  1107. * Set receiveInformationsFromOrganizationWish
  1108. *
  1109. * @param boolean $receiveInformationsFromOrganizationWish
  1110. *
  1111. * @return AccessWish
  1112. */
  1113. public function setReceiveInformationsFromOrganizationWish($receiveInformationsFromOrganizationWish)
  1114. {
  1115. $this->receiveInformationsFromOrganizationWish = $receiveInformationsFromOrganizationWish;
  1116. return $this;
  1117. }
  1118. /**
  1119. * Get receiveInformationsFromOrganizationWish
  1120. *
  1121. * @return boolean
  1122. */
  1123. public function getReceiveInformationsFromOrganizationWish()
  1124. {
  1125. return $this->receiveInformationsFromOrganizationWish;
  1126. }
  1127. /**
  1128. * Set isNewMemberFamily
  1129. *
  1130. * @param boolean $isNewMemberFamily
  1131. *
  1132. * @return AccessWish
  1133. */
  1134. public function setIsNewMemberFamily($isNewMemberFamily)
  1135. {
  1136. $this->isNewMemberFamily = $isNewMemberFamily;
  1137. return $this;
  1138. }
  1139. /**
  1140. * Get isNewMemberFamily
  1141. *
  1142. * @return boolean
  1143. */
  1144. public function getIsNewMemberFamily()
  1145. {
  1146. return $this->isNewMemberFamily;
  1147. }
  1148. /**
  1149. * Add tag
  1150. *
  1151. * @param \AppBundle\Entity\Core\Tagg $tag
  1152. *
  1153. * @return AccessWish
  1154. */
  1155. public function addTag(\AppBundle\Entity\Core\Tagg $tag)
  1156. {
  1157. $this->tags[] = $tag;
  1158. return $this;
  1159. }
  1160. /**
  1161. * Remove tag
  1162. *
  1163. * @param \AppBundle\Entity\Core\Tagg $tag
  1164. */
  1165. public function removeTag(\AppBundle\Entity\Core\Tagg $tag)
  1166. {
  1167. $this->tags->removeElement($tag);
  1168. }
  1169. /**
  1170. * Get tags
  1171. *
  1172. * @return \Doctrine\Common\Collections\Collection
  1173. */
  1174. public function getTags()
  1175. {
  1176. return $this->tags;
  1177. }
  1178. public function getAgeTemplate()
  1179. {
  1180. $from = new \DateTime($this->getBirthDate());
  1181. $to = new \DateTime('today');
  1182. $age = $from->diff($to)->y;
  1183. return $age > 0 ? $age : null;
  1184. }
  1185. /**
  1186. * Gets full name.
  1187. *
  1188. * @return array
  1189. */
  1190. public function getFullNameAndContactTemplate()
  1191. {
  1192. if(!empty($this->getGenderEnum())){
  1193. $fullNameAndContactTemplate[] = [ 'value' => $this->getGenderEnum(), 'translate' => true ];
  1194. $fullNameAndContactTemplate[] = ' - ';
  1195. }
  1196. $fullNameAndContactTemplate[] = $this->getFullNameTemplate();
  1197. if(!empty($this->getEmail()) || !empty($this->getTelphone()) || !empty($this->getMobilPhone())){
  1198. $fullNameAndContactTemplate[] = ' - ';
  1199. if(!empty($this->getEmail()))
  1200. $fullNameAndContactTemplate[] = $this->getEmail();
  1201. if(!empty($this->getTelphone()))
  1202. $fullNameAndContactTemplate[] = ['type' => 'phone_number', 'value' => $this->getTelphone(), 'separator' => ' / '];
  1203. if(!empty($this->getMobilPhone()))
  1204. $fullNameAndContactTemplate[] = ['type' => 'phone_number', 'value' => $this->getMobilPhone(), 'separator' => ' / '];
  1205. }
  1206. if(!empty($this->getStreetAddress()) || !empty($this->getCityName())){
  1207. $fullNameAndContactTemplate[] = ' - ';
  1208. if(!empty($this->getStreetAddress()))
  1209. $fullNameAndContactTemplate[] = $this->getStreetAddress();
  1210. if(!empty($this->getPostalCode()))
  1211. $fullNameAndContactTemplate[] = $this->getPostalCode();
  1212. if(!empty($this->getCityName()))
  1213. $fullNameAndContactTemplate[] = $this->getCityName();
  1214. }
  1215. return $fullNameAndContactTemplate;
  1216. }
  1217. /**
  1218. * Set validationState
  1219. *
  1220. * @param string $validationState
  1221. *
  1222. * @return AccessWish
  1223. */
  1224. public function setValidationState($validationState)
  1225. {
  1226. $this->validationState = $validationState;
  1227. return $this;
  1228. }
  1229. /**
  1230. * Get validationState
  1231. *
  1232. * @return string
  1233. */
  1234. public function getValidationState()
  1235. {
  1236. return $this->validationState;
  1237. }
  1238. /**
  1239. * Set isValidated
  1240. *
  1241. * @param boolean $isValidated
  1242. *
  1243. * @return AccessWish
  1244. */
  1245. public function setIsValidated($isValidated)
  1246. {
  1247. $this->isValidated = $isValidated;
  1248. return $this;
  1249. }
  1250. /**
  1251. * Get isValidated
  1252. *
  1253. * @return boolean
  1254. */
  1255. public function getIsValidated()
  1256. {
  1257. return $this->isValidated;
  1258. }
  1259. }