src/Entity/Apprenant.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ApprenantRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=ApprenantRepository::class)
  9. */
  10. class Apprenant
  11. {
  12. /**
  13. * @ORM\Id()
  14. * @ORM\GeneratedValue()
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\OneToMany(targetEntity=Appel::class, mappedBy="apprenant")
  20. */
  21. private $appels;
  22. /**
  23. * @ORM\Column(type="integer", nullable=true)
  24. */
  25. private $idUser;
  26. /**
  27. * @ORM\Column(type="string", length=255, nullable=true)
  28. */
  29. private $firstname;
  30. /**
  31. * @ORM\Column(type="string", length=255, nullable=true)
  32. */
  33. private $lastname;
  34. /**
  35. * @ORM\Column(type="string", length=255, nullable=true)
  36. */
  37. private $email;
  38. /**
  39. * @ORM\Column(type="integer", nullable=true)
  40. */
  41. private $type;
  42. /**
  43. * @ORM\ManyToOne(targetEntity=Projet::class, inversedBy="apprenants")
  44. * @ORM\JoinColumn(name="id_projet", referencedColumnName="id")
  45. */
  46. private $projet;
  47. /**
  48. * @ORM\Column(type="string", length=255, nullable=true)
  49. */
  50. private $gsm;
  51. /**
  52. * @ORM\Column(type="string", length=255, nullable=true)
  53. */
  54. private $username;
  55. /**
  56. * @ORM\Column(type="string", length=255, nullable=true)
  57. */
  58. private $gsm2;
  59. /**
  60. * @ORM\Column(type="integer", nullable=true)
  61. */
  62. private $permission_appel;
  63. /**
  64. * @ORM\Column(type="integer", nullable=true)
  65. */
  66. private $categorie;
  67. /**
  68. * @ORM\Column(type="string", length=255, nullable=true)
  69. */
  70. private $last_access;
  71. /**
  72. * @ORM\Column(name="dateModif",type="string", length=255, nullable=true)
  73. */
  74. private $dateModif;
  75. /**
  76. * @ORM\Column(type="string", length=255, nullable=true)
  77. */
  78. private $direction;
  79. /**
  80. * @ORM\Column(name="firstAccessSpeexx",type="string", length=255, nullable=true)
  81. */
  82. private $firstAccessSpeexx;
  83. /**
  84. * @ORM\Column(name="lastAccessSpeexx",type="string", length=255, nullable=true)
  85. */
  86. private $lastAccessSpeexx;
  87. /**
  88. * @ORM\Column(name="timePromo1",type="integer", nullable=true)
  89. */
  90. private $timePromo1;
  91. /**
  92. * @ORM\Column(type="string", length=255, nullable=true)
  93. */
  94. private $profil;
  95. /**
  96. * @ORM\Column(name="testOral",type="integer",options={"default" : 0},nullable=true)
  97. */
  98. private $testOral;
  99. /**
  100. * @ORM\Column(type="string", length=255, nullable=true)
  101. */
  102. private $poste;
  103. /**
  104. * @ORM\Column(type="string", length=255, nullable=true)
  105. */
  106. private $password;
  107. /**
  108. * @ORM\Column(name="noteOral",type="string", length=255, nullable=true)
  109. */
  110. private $noteOral;
  111. /**
  112. * @ORM\OneToMany(targetEntity=Inscription::class, mappedBy="apprenant")
  113. */
  114. private $inscriptions;
  115. /**
  116. * @ORM\OneToMany(targetEntity=Message::class, mappedBy="apprenant")
  117. */
  118. private $messages;
  119. /**
  120. * @ORM\OneToMany(targetEntity=Rdv::class, mappedBy="apprenant")
  121. */
  122. private $rdvs;
  123. /**
  124. * @ORM\OneToMany(targetEntity=Seance::class, mappedBy="apprenant")
  125. */
  126. private $seances;
  127. /**
  128. * @ORM\OneToMany(targetEntity=Tache::class, mappedBy="apprenant")
  129. */
  130. private $taches;
  131. /**
  132. * @ORM\Column(name="date_permission_appel", type="string", length=255, nullable=true, options={"comment":"Date de fin pour Interdiction d'appel"})
  133. */
  134. private $DatePermissionAppel;
  135. /**
  136. * @ORM\Column(name="raison_permission_appel", type="string", length=255, nullable=true, options={"comment":"La raison pour Interdiction d'appel"})
  137. */
  138. private $RaisonPermissionAppel;
  139. /**
  140. * @ORM\Column(type="integer",options={"default" : 0}, nullable=true)
  141. */
  142. private $priority;
  143. /**
  144. * @ORM\Column(type="string", length=255, nullable=true)
  145. */
  146. private $creneau;
  147. /**
  148. * @ORM\OneToMany(targetEntity=Incident::class, mappedBy="apprenant", orphanRemoval=true)
  149. */
  150. private $incidents;
  151. /**
  152. * @ORM\Column(type="string", length=255, nullable=true)
  153. */
  154. private $fonction;
  155. /**
  156. * @ORM\Column(type="string", length=255, nullable=true)
  157. */
  158. private $qualificationWebi;
  159. public function __construct()
  160. {
  161. $this->appels = new ArrayCollection();
  162. $this->inscriptions = new ArrayCollection();
  163. $this->messages = new ArrayCollection();
  164. $this->rdvs = new ArrayCollection();
  165. $this->seances = new ArrayCollection();
  166. $this->taches = new ArrayCollection();
  167. $this->incidents = new ArrayCollection();
  168. }
  169. public function getId(): ?int
  170. {
  171. return $this->id;
  172. }
  173. /**
  174. * @return Collection|Appel[]
  175. */
  176. public function getAppels(): Collection
  177. {
  178. return $this->appels;
  179. }
  180. public function addAppel(Appel $appel): self
  181. {
  182. if (!$this->appels->contains($appel)) {
  183. $this->appels[] = $appel;
  184. $appel->setApprenant($this);
  185. }
  186. return $this;
  187. }
  188. public function removeAppel(Appel $appel): self
  189. {
  190. if ($this->appels->contains($appel)) {
  191. $this->appels->removeElement($appel);
  192. // set the owning side to null (unless already changed)
  193. if ($appel->getApprenant() === $this) {
  194. $appel->setApprenant(null);
  195. }
  196. }
  197. return $this;
  198. }
  199. public function getIdUser(): ?int
  200. {
  201. return $this->idUser;
  202. }
  203. public function setIdUser(?int $idUser): self
  204. {
  205. $this->idUser = $idUser;
  206. return $this;
  207. }
  208. public function getFirstname(): ?string
  209. {
  210. return $this->firstname;
  211. }
  212. public function setFirstname(?string $firstname): self
  213. {
  214. $this->firstname = $firstname;
  215. return $this;
  216. }
  217. public function getLastname(): ?string
  218. {
  219. return $this->lastname;
  220. }
  221. public function setLastname(?string $lastname): self
  222. {
  223. $this->lastname = $lastname;
  224. return $this;
  225. }
  226. public function getEmail(): ?string
  227. {
  228. return $this->email;
  229. }
  230. public function setEmail(?string $email): self
  231. {
  232. $this->email = $email;
  233. return $this;
  234. }
  235. public function getType(): ?int
  236. {
  237. return $this->type;
  238. }
  239. public function setType(?int $type): self
  240. {
  241. $this->type = $type;
  242. return $this;
  243. }
  244. public function getProjet(): ?Projet
  245. {
  246. return $this->projet;
  247. }
  248. public function setProjet(?Projet $projet): self
  249. {
  250. $this->projet = $projet;
  251. return $this;
  252. }
  253. public function getGsm(): ?string
  254. {
  255. return $this->gsm;
  256. }
  257. public function setGsm(?string $gsm): self
  258. {
  259. $this->gsm = $gsm;
  260. return $this;
  261. }
  262. public function getUsername(): ?string
  263. {
  264. return $this->username;
  265. }
  266. public function setUsername(?string $username): self
  267. {
  268. $this->username = $username;
  269. return $this;
  270. }
  271. public function getGsm2(): ?string
  272. {
  273. return $this->gsm2;
  274. }
  275. public function setGsm2(?string $gsm2): self
  276. {
  277. $this->gsm2 = $gsm2;
  278. return $this;
  279. }
  280. public function getPermissionAppel(): ?int
  281. {
  282. return $this->permission_appel;
  283. }
  284. public function setPermissionAppel(?int $permission_appel): self
  285. {
  286. $this->permission_appel = $permission_appel;
  287. return $this;
  288. }
  289. public function getCategorie(): ?int
  290. {
  291. return $this->categorie;
  292. }
  293. public function setCategorie(?int $categorie): self
  294. {
  295. $this->categorie = $categorie;
  296. return $this;
  297. }
  298. public function getLastAccess(): ?string
  299. {
  300. return $this->last_access;
  301. }
  302. public function setLastAccess(?string $last_access): self
  303. {
  304. $this->last_access = $last_access;
  305. return $this;
  306. }
  307. public function getDateModif(): ?string
  308. {
  309. return $this->dateModif;
  310. }
  311. public function setDateModif(?string $dateModif): self
  312. {
  313. $this->dateModif = $dateModif;
  314. return $this;
  315. }
  316. public function getDirection(): ?string
  317. {
  318. return $this->direction;
  319. }
  320. public function setDirection(?string $direction): self
  321. {
  322. $this->direction = $direction;
  323. return $this;
  324. }
  325. public function getFirstAccessSpeexx(): ?string
  326. {
  327. return $this->firstAccessSpeexx;
  328. }
  329. public function setFirstAccessSpeexx(?string $firstAccessSpeexx): self
  330. {
  331. $this->firstAccessSpeexx = $firstAccessSpeexx;
  332. return $this;
  333. }
  334. public function getLastAccessSpeexx(): ?string
  335. {
  336. return $this->lastAccessSpeexx;
  337. }
  338. public function setLastAccessSpeexx(?string $lastAccessSpeexx): self
  339. {
  340. $this->lastAccessSpeexx = $lastAccessSpeexx;
  341. return $this;
  342. }
  343. public function getTimePromo1(): ?int
  344. {
  345. return $this->timePromo1;
  346. }
  347. public function setTimePromo1(?int $timePromo1): self
  348. {
  349. $this->timePromo1 = $timePromo1;
  350. return $this;
  351. }
  352. public function getProfil(): ?string
  353. {
  354. return $this->profil;
  355. }
  356. public function setProfil(?string $profil): self
  357. {
  358. $this->profil = $profil;
  359. return $this;
  360. }
  361. public function getTestOral(): ?int
  362. {
  363. return $this->testOral;
  364. }
  365. public function setTestOral(int $testOral): self
  366. {
  367. $this->testOral = $testOral;
  368. return $this;
  369. }
  370. public function getPoste(): ?string
  371. {
  372. return $this->poste;
  373. }
  374. public function setPoste(?string $poste): self
  375. {
  376. $this->poste = $poste;
  377. return $this;
  378. }
  379. public function getPassword(): ?string
  380. {
  381. return $this->password;
  382. }
  383. public function setPassword(?string $password): self
  384. {
  385. $this->password = $password;
  386. return $this;
  387. }
  388. public function getNoteOral(): ?int
  389. {
  390. return $this->noteOral;
  391. }
  392. public function setNoteOral(?int $noteOral): self
  393. {
  394. $this->noteOral = $noteOral;
  395. return $this;
  396. }
  397. /**
  398. * @return Collection|Inscription[]
  399. */
  400. public function getInscriptions(): Collection
  401. {
  402. return $this->inscriptions;
  403. }
  404. public function addInscription(Inscription $inscription): self
  405. {
  406. if (!$this->inscriptions->contains($inscription)) {
  407. $this->inscriptions[] = $inscription;
  408. $inscription->setApprenant($this);
  409. }
  410. return $this;
  411. }
  412. public function removeInscription(Inscription $inscription): self
  413. {
  414. if ($this->inscriptions->contains($inscription)) {
  415. $this->inscriptions->removeElement($inscription);
  416. // set the owning side to null (unless already changed)
  417. if ($inscription->getApprenant() === $this) {
  418. $inscription->setApprenant(null);
  419. }
  420. }
  421. return $this;
  422. }
  423. /**
  424. * @return Collection|Message[]
  425. */
  426. public function getMessages(): Collection
  427. {
  428. return $this->messages;
  429. }
  430. public function addMessage(Message $message): self
  431. {
  432. if (!$this->messages->contains($message)) {
  433. $this->messages[] = $message;
  434. $message->setApprenant($this);
  435. }
  436. return $this;
  437. }
  438. public function removeMessage(Message $message): self
  439. {
  440. if ($this->messages->contains($message)) {
  441. $this->messages->removeElement($message);
  442. // set the owning side to null (unless already changed)
  443. if ($message->getApprenant() === $this) {
  444. $message->setApprenant(null);
  445. }
  446. }
  447. return $this;
  448. }
  449. /**
  450. * @return Collection|Rdv[]
  451. */
  452. public function getRdvs(): Collection
  453. {
  454. return $this->rdvs;
  455. }
  456. public function addRdv(Rdv $rdv): self
  457. {
  458. if (!$this->rdvs->contains($rdv)) {
  459. $this->rdvs[] = $rdv;
  460. $rdv->setApprenant($this);
  461. }
  462. return $this;
  463. }
  464. public function removeRdv(Rdv $rdv): self
  465. {
  466. if ($this->rdvs->contains($rdv)) {
  467. $this->rdvs->removeElement($rdv);
  468. // set the owning side to null (unless already changed)
  469. if ($rdv->getApprenant() === $this) {
  470. $rdv->setApprenant(null);
  471. }
  472. }
  473. return $this;
  474. }
  475. /**
  476. * @return Collection|Seance[]
  477. */
  478. public function getSeances(): Collection
  479. {
  480. return $this->seances;
  481. }
  482. public function addSeance(Seance $seance): self
  483. {
  484. if (!$this->seances->contains($seance)) {
  485. $this->seances[] = $seance;
  486. $seance->setApprenant($this);
  487. }
  488. return $this;
  489. }
  490. public function removeSeance(Seance $seance): self
  491. {
  492. if ($this->seances->contains($seance)) {
  493. $this->seances->removeElement($seance);
  494. // set the owning side to null (unless already changed)
  495. if ($seance->getApprenant() === $this) {
  496. $seance->setApprenant(null);
  497. }
  498. }
  499. return $this;
  500. }
  501. /**
  502. * @return Collection|Tache[]
  503. */
  504. public function getTaches(): Collection
  505. {
  506. return $this->taches;
  507. }
  508. public function addTach(Tache $tach): self
  509. {
  510. if (!$this->taches->contains($tach)) {
  511. $this->taches[] = $tach;
  512. $tach->setApprenant($this);
  513. }
  514. return $this;
  515. }
  516. public function removeTach(Tache $tach): self
  517. {
  518. if ($this->taches->contains($tach)) {
  519. $this->taches->removeElement($tach);
  520. // set the owning side to null (unless already changed)
  521. if ($tach->getApprenant() === $this) {
  522. $tach->setApprenant(null);
  523. }
  524. }
  525. return $this;
  526. }
  527. public function getDatePermissionAppel(): ?string
  528. {
  529. return $this->DatePermissionAppel;
  530. }
  531. public function setDatePermissionAppel(?string $DatePermissionAppel): self
  532. {
  533. $this->DatePermissionAppel = $DatePermissionAppel;
  534. return $this;
  535. }
  536. public function getRaisonPermissionAppel(): ?string
  537. {
  538. return $this->RaisonPermissionAppel;
  539. }
  540. public function setRaisonPermissionAppel(?string $RaisonPermissionAppel): self
  541. {
  542. $this->RaisonPermissionAppel = $RaisonPermissionAppel;
  543. return $this;
  544. }
  545. public function getRaisonsInterdictiondAppel()
  546. {
  547. $listRaisons = array(1 => 'Retraite', 2 => 'Pas Intéressé', 3 => 'Occupation urgente', 4 => 'Congé Maternel', 5 => 'Arrêt Maladie', 6 => 'Désistement', 7 => 'Décès', 8 => "Rendez-vous", 100 => 'Autres');
  548. return $listRaisons;
  549. }
  550. /**
  551. * Traiter le numéro GSM
  552. * @return void
  553. */
  554. public function getValideGSM($gsm)
  555. {
  556. $newGsm = '';
  557. $trimGsm = str_replace("+", "", str_replace(" ", "", str_replace(".", "", str_replace("(", "", str_replace(")", "", str_replace("(", "", str_replace("-", "", str_replace("(", "", str_replace("_", "", $gsm)))))))));
  558. if (substr($trimGsm, 0, 3) == "212") {
  559. $newGsm = "00" . $trimGsm;
  560. } elseif (substr($trimGsm, 0, 1) == "5") {
  561. $newGsm = "0" . $trimGsm;
  562. } elseif (substr($trimGsm, 0, 1) == "6") {
  563. $newGsm = "0" . $trimGsm;
  564. } elseif (substr($trimGsm, 0, 1) == "7") {
  565. $newGsm = "0" . $trimGsm;
  566. } else {
  567. $newGsm = $trimGsm;
  568. }
  569. return $newGsm;
  570. }
  571. public function getPriority(): ?int
  572. {
  573. return $this->priority;
  574. }
  575. public function setPriority(?int $priority): self
  576. {
  577. $this->priority = $priority;
  578. return $this;
  579. }
  580. public function getCreneau(): ?string
  581. {
  582. return $this->creneau;
  583. }
  584. public function setCreneau(?string $creneau): self
  585. {
  586. $this->creneau = $creneau;
  587. return $this;
  588. }
  589. /**
  590. * @return Collection|Incident[]
  591. */
  592. public function getIncidents(): Collection
  593. {
  594. return $this->incidents;
  595. }
  596. public function addIncident(Incident $incident): self
  597. {
  598. if (!$this->incidents->contains($incident)) {
  599. $this->incidents[] = $incident;
  600. $incident->setApprenant($this);
  601. }
  602. return $this;
  603. }
  604. public function removeIncident(Incident $incident): self
  605. {
  606. if ($this->incidents->removeElement($incident)) {
  607. // set the owning side to null (unless already changed)
  608. if ($incident->getApprenant() === $this) {
  609. $incident->setApprenant(null);
  610. }
  611. }
  612. return $this;
  613. }
  614. public function getFonction(): ?string
  615. {
  616. return $this->fonction;
  617. }
  618. public function setFonction(?string $fonction): self
  619. {
  620. $this->fonction = $fonction;
  621. return $this;
  622. }
  623. public function getQualificationWebi(): ?string
  624. {
  625. return $this->qualificationWebi;
  626. }
  627. public function setQualificationWebi(?string $qualificationWebi): self
  628. {
  629. $this->qualificationWebi = $qualificationWebi;
  630. return $this;
  631. }
  632. }