src/Entity/Sejour.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SejourRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use function PHPSTORM_META\map;
  8. /**
  9. * @ORM\Entity(repositoryClass=SejourRepository::class)
  10. */
  11. class Sejour
  12. {
  13. const MOIS =[
  14. "1" => "Janvier",
  15. "01" => "Janvier",
  16. "02" => "Février",
  17. "03" => "Mars",
  18. "04" => "Avril",
  19. "05" => "Mai",
  20. "06" => "Juin",
  21. "07" => "Juillet",
  22. "08" => "Aout",
  23. "09" => "Septembre",
  24. "10" => "Octobre",
  25. "11" => "Novembre",
  26. "12" => "Décembre",
  27. ];
  28. /**
  29. * @ORM\Id
  30. * @ORM\GeneratedValue
  31. * @ORM\Column(type="integer")
  32. */
  33. private $id;
  34. /**
  35. * @ORM\Column(type="string", length=255)
  36. */
  37. private $title;
  38. /**
  39. * @ORM\Column(type="text")
  40. */
  41. private $description;
  42. /**
  43. * @ORM\Column(type="text")
  44. */
  45. private $activites;
  46. /**
  47. * @ORM\Column(type="date",nullable= true)
  48. */
  49. private $updatedDate;
  50. /**
  51. * @ORM\Column(type="text")
  52. */
  53. private $hebergement;
  54. /**
  55. * @ORM\OneToMany(targetEntity=SejourSession::class, mappedBy="sejour", cascade={"persist", "remove"})
  56. * @ORM\OrderBy({"dateDebut" = "ASC"})
  57. */
  58. private $sejourSessions;
  59. /**
  60. * @ORM\Column(type="boolean")
  61. */
  62. private $isActive;
  63. /**
  64. * @ORM\Column(type="boolean", options={"default" = true})
  65. */
  66. private $isBientot;
  67. /**
  68. * @ORM\Column(type="boolean")
  69. */
  70. private $isObjectifZeroCo2;
  71. /**
  72. * @ORM\ManyToMany(targetEntity=Theme::class, inversedBy="sejours")
  73. */
  74. private $themes;
  75. /**
  76. * @ORM\ManyToMany(targetEntity=Country::class, inversedBy="sejours")
  77. */
  78. private $countries;
  79. /**
  80. * @ORM\Column(type="integer", nullable=true)
  81. */
  82. private $position;
  83. /**
  84. * @ORM\OneToOne(targetEntity=Location::class, inversedBy="sejour", cascade={"persist", "remove"})
  85. */
  86. private $location;
  87. /**
  88. * @ORM\OneToMany(targetEntity=MajorationTransport::class, mappedBy="sejour", cascade={"persist", "remove"})
  89. * @ORM\OrderBy({"ville" = "ASC"})
  90. */
  91. private $majorationTransports;
  92. /**
  93. * @ORM\OneToMany(targetEntity=SejourEquipier::class, mappedBy="sejour", cascade={"persist", "remove"})
  94. */
  95. private $sejourEquipiers;
  96. /**
  97. * @ORM\Column(type="integer")
  98. */
  99. private $ageMin;
  100. /**
  101. * @ORM\Column(type="integer")
  102. */
  103. private $ageMax;
  104. /**
  105. * @ORM\ManyToMany(targetEntity=Saison::class, inversedBy="sejours")
  106. */
  107. private $saisons;
  108. /**
  109. * @ORM\Column(type="boolean", nullable=true)
  110. */
  111. private $isSejourLocation;
  112. /**
  113. * @ORM\Column(type="boolean", nullable=true)
  114. */
  115. private $isSejourCourt;
  116. /**
  117. * @ORM\Column(type="string", length=511, nullable=true)
  118. */
  119. private $notreAvis;
  120. /**
  121. * @ORM\Column(type="text", nullable=true)
  122. */
  123. private $tarifs;
  124. /**
  125. * @ORM\Column(type="integer")
  126. */
  127. private $placesCount;
  128. /**
  129. * @ORM\OneToMany(targetEntity=Media::class, mappedBy="sejour",cascade={"persist", "remove"})
  130. */
  131. private $medias;
  132. /**
  133. * @ORM\Column(type="integer", nullable=true)
  134. */
  135. private $legacyId;
  136. /**
  137. * @ORM\Column(type="text", nullable=true)
  138. */
  139. private $intro;
  140. /**
  141. * @ORM\Column(type="float", nullable=true)
  142. */
  143. private $price;
  144. /**
  145. * @ORM\Column(type="string", length=511, nullable=true)
  146. */
  147. private $duree;
  148. /**
  149. * @ORM\Column(type="text", nullable=true)
  150. */
  151. private $encadrement;
  152. /**
  153. * @ORM\Column(type="string", length=255)
  154. */
  155. private $nombre;
  156. /**
  157. * @ORM\Column(type="integer", nullable=true)
  158. */
  159. private $dureeInteger;
  160. /**
  161. * @ORM\Column(type="text", nullable=true)
  162. */
  163. private $tranport;
  164. /**
  165. * @ORM\Column(type="text", nullable=true)
  166. */
  167. private $transport;
  168. /**
  169. * @ORM\Column(type="text", nullable=true)
  170. */
  171. private $compris;
  172. /**
  173. * @ORM\Column(type="text")
  174. */
  175. private $noncompris;
  176. /**
  177. * @ORM\Column(type="text")
  178. */
  179. private $informationComplementaire;
  180. /**
  181. * @ORM\ManyToMany(targetEntity=Property::class, inversedBy="sejours")
  182. */
  183. private $property;
  184. /**
  185. * @ORM\OneToMany(targetEntity=Temoignage::class, mappedBy="sejour",cascade={"persist", "remove"})
  186. */
  187. private $temoignages;
  188. /**
  189. * @ORM\Column(type="string", length=511, nullable=true)
  190. */
  191. private $url;
  192. /**
  193. * @ORM\Column(type="string", length=255, nullable=true)
  194. */
  195. private $sejourType;
  196. /**
  197. * @ORM\ManyToMany(targetEntity=TrancheAge::class, inversedBy="sejours")
  198. */
  199. private $trancheAges;
  200. /**
  201. * @ORM\ManyToOne(targetEntity=TrancheAge::class, inversedBy="sejoursMin")
  202. */
  203. private $trancheAge1;
  204. /**
  205. * @ORM\ManyToOne(targetEntity=TrancheAge::class, inversedBy="sejoursMax")
  206. */
  207. private $trancheAge2;
  208. /**
  209. * @ORM\Column(type="string", length=511, nullable=true)
  210. */
  211. private $videoLink;
  212. /**
  213. * @ORM\Column(type="string", length=511, nullable=true)
  214. */
  215. private $activitesFicheSejour;
  216. /**
  217. * @ORM\Column(type="string", length=511, nullable=true)
  218. */
  219. private $lienYoutube;
  220. /**
  221. * @ORM\OneToMany(targetEntity="App\Entity\SejourWhitelist", mappedBy="sejour")
  222. */
  223. private $whitelists;
  224. public function __construct()
  225. {
  226. $this->sejourSessions = new ArrayCollection();
  227. $this->themes = new ArrayCollection();
  228. $this->majorationTransports = new ArrayCollection();
  229. $this->sejourEquipiers = new ArrayCollection();
  230. $this->saisons = new ArrayCollection();
  231. $this->medias = new ArrayCollection();
  232. $this->countries = new ArrayCollection();
  233. $this->noncompris ="argent de poche";
  234. $this->property = new ArrayCollection();
  235. $this->temoignages = new ArrayCollection();
  236. $this->isBientot = false;
  237. }
  238. public function getId(): ?int
  239. {
  240. return $this->id;
  241. }
  242. public function getTitle(): ?string
  243. {
  244. return $this->title;
  245. }
  246. public function setTitle(string $title): self
  247. {
  248. $this->title = $title;
  249. return $this;
  250. }
  251. public function getDescription(): ?string
  252. {
  253. return $this->description;
  254. }
  255. public function setDescription(string $description): self
  256. {
  257. $this->description = $description;
  258. return $this;
  259. }
  260. public function getActivites(): ?string
  261. {
  262. return $this->activites;
  263. }
  264. public function setActivites(string $activites): self
  265. {
  266. $this->activites = $activites;
  267. return $this;
  268. }
  269. public function getHebergement(): ?string
  270. {
  271. return $this->hebergement;
  272. }
  273. public function setHebergement(string $hebergement): self
  274. {
  275. $this->hebergement = $hebergement;
  276. return $this;
  277. }
  278. /**
  279. * @return Collection|SejourSession[]
  280. */
  281. public function getSejourSessions(): Collection
  282. {
  283. return $this->sejourSessions;
  284. }
  285. public function addSejourSession(SejourSession $sejourSession): self
  286. {
  287. if (!$this->sejourSessions->contains($sejourSession)) {
  288. $this->sejourSessions[] = $sejourSession;
  289. $sejourSession->setSejour($this);
  290. }
  291. return $this;
  292. }
  293. public function removeSejourSession(SejourSession $sejourSession): self
  294. {
  295. if ($this->sejourSessions->removeElement($sejourSession)) {
  296. // set the owning side to null (unless already changed)
  297. if ($sejourSession->getSejour() === $this) {
  298. $sejourSession->setSejour(null);
  299. }
  300. }
  301. return $this;
  302. }
  303. public function getIsActive(): ?bool
  304. {
  305. return $this->isActive;
  306. }
  307. public function setIsActive(bool $isActive): self
  308. {
  309. $this->isActive = $isActive;
  310. return $this;
  311. }
  312. public function getBientot(): ?bool
  313. {
  314. return $this->isBientot;
  315. }
  316. public function setBientot(bool $isBientot): self
  317. {
  318. $this->isBientot = $isBientot;
  319. return $this;
  320. }
  321. public function getIsObjectifZeroCo2(): ?bool
  322. {
  323. return $this->isObjectifZeroCo2;
  324. }
  325. public function setIsObjectifZeroCo2(bool $isObjectifZeroCo2): self
  326. {
  327. $this->isObjectifZeroCo2 = $isObjectifZeroCo2;
  328. return $this;
  329. }
  330. /**
  331. * @return Collection|Theme[]
  332. */
  333. public function getThemes(): Collection
  334. {
  335. return $this->themes;
  336. }
  337. public function addTheme(Theme $theme): self
  338. {
  339. if (!$this->themes->contains($theme)) {
  340. $this->themes[] = $theme;
  341. }
  342. return $this;
  343. }
  344. public function addThemes(iterable $themes): self
  345. {
  346. foreach($themes as $theme)
  347. $this->addTheme($theme);
  348. return $this;
  349. }
  350. public function removeTheme(Theme $theme): self
  351. {
  352. $this->themes->removeElement($theme);
  353. return $this;
  354. }
  355. /**
  356. * @return Collection|Theme[]
  357. */
  358. public function getCountries(): Collection
  359. {
  360. return $this->countries;
  361. }
  362. public function addCountry(Country $country): self
  363. {
  364. if (!$this->countries->contains($country)) {
  365. $this->countries[] = $country;
  366. }
  367. return $this;
  368. }
  369. public function addCountries(iterable $countries): self
  370. {
  371. foreach($countries as $country)
  372. $this->addTheme($country);
  373. return $this;
  374. }
  375. public function removeCountry(Country $country): self
  376. {
  377. $this->countries->removeElement($country);
  378. return $this;
  379. }
  380. public function getPosition(): ?int
  381. {
  382. return $this->position;
  383. }
  384. public function setPosition(?int $position): self
  385. {
  386. $this->position = $position;
  387. return $this;
  388. }
  389. public function getLocation(): ?Location
  390. {
  391. return $this->location;
  392. }
  393. public function setLocation(?Location $location): self
  394. {
  395. $this->location = $location;
  396. return $this;
  397. }
  398. /**
  399. * @return Collection|MajorationTransport[]
  400. */
  401. public function getMajorationTransports(): Collection
  402. {
  403. return $this->majorationTransports;
  404. }
  405. public function addMajorationTransport(MajorationTransport $majorationTransport): self
  406. {
  407. if (!$this->majorationTransports->contains($majorationTransport)) {
  408. $this->majorationTransports[] = $majorationTransport;
  409. $majorationTransport->setSejour($this);
  410. }
  411. return $this;
  412. }
  413. public function removeMajorationTransport(MajorationTransport $majorationTransport): self
  414. {
  415. if ($this->majorationTransports->removeElement($majorationTransport)) {
  416. // set the owning side to null (unless already changed)
  417. if ($majorationTransport->getSejour() === $this) {
  418. $majorationTransport->setSejour(null);
  419. }
  420. }
  421. return $this;
  422. }
  423. /**
  424. * @return Collection|SejourEquipier[]
  425. */
  426. public function getSejourEquipiers(): Collection
  427. {
  428. return $this->sejourEquipiers;
  429. }
  430. public function addSejourEquipier(SejourEquipier $sejourEquipier): self
  431. {
  432. if (!$this->sejourEquipiers->contains($sejourEquipier)) {
  433. $this->sejourEquipiers[] = $sejourEquipier;
  434. $sejourEquipier->setSejour($this);
  435. }
  436. return $this;
  437. }
  438. public function removeSejourEquipier(SejourEquipier $sejourEquipier): self
  439. {
  440. if ($this->sejourEquipiers->removeElement($sejourEquipier)) {
  441. // set the owning side to null (unless already changed)
  442. if ($sejourEquipier->getSejour() === $this) {
  443. $sejourEquipier->setSejour(null);
  444. }
  445. }
  446. return $this;
  447. }
  448. public function getAgeMin(): ?int
  449. {
  450. return $this->ageMin;
  451. }
  452. public function setAgeMin(int $ageMin): self
  453. {
  454. $this->ageMin = $ageMin;
  455. return $this;
  456. }
  457. public function getAgeMax(): ?int
  458. {
  459. return $this->ageMax;
  460. }
  461. public function setAgeMax(int $ageMax): self
  462. {
  463. $this->ageMax = $ageMax;
  464. return $this;
  465. }
  466. /**
  467. * @return Collection|Saison[]
  468. */
  469. public function getSaisons(): Collection
  470. {
  471. return $this->saisons;
  472. }
  473. public function addSaison(Saison $saison): self
  474. {
  475. if (!$this->saisons->contains($saison)) {
  476. $this->saisons[] = $saison;
  477. }
  478. return $this;
  479. }
  480. public function removeSaison(Saison $saison): self
  481. {
  482. $this->saisons->removeElement($saison);
  483. return $this;
  484. }
  485. public function getIsSejourLocation(): ?bool
  486. {
  487. return $this->isSejourLocation;
  488. }
  489. public function setIsSejourLocation(?bool $isSejourLocation): self
  490. {
  491. $this->isSejourLocation = $isSejourLocation;
  492. return $this;
  493. }
  494. public function getIsSejourCourt(): ?bool
  495. {
  496. return $this->isSejourCourt;
  497. }
  498. public function setIsSejourCourt(?bool $isSejourLocation): self
  499. {
  500. $this->isSejourCourt = $isSejourLocation;
  501. return $this;
  502. }
  503. public function getNotreAvis(): ?string
  504. {
  505. return $this->notreAvis;
  506. }
  507. public function setNotreAvis(?string $notreAvis): self
  508. {
  509. $this->notreAvis = $notreAvis;
  510. return $this;
  511. }
  512. public function getTarifs(): ?string
  513. {
  514. return $this->tarifs;
  515. }
  516. public function setTarifs(?string $tarifs): self
  517. {
  518. $this->tarifs = $tarifs;
  519. return $this;
  520. }
  521. public function getPlacesCount(): ?int
  522. {
  523. return $this->placesCount;
  524. }
  525. public function setPlacesCount(int $placesCount): self
  526. {
  527. $this->placesCount = $placesCount;
  528. $this->nombre = $placesCount;
  529. return $this;
  530. }
  531. /**
  532. * @return Collection|SejourSession[]
  533. */
  534. public function getFutureSejourSessions(): array
  535. {
  536. $output = [];
  537. $date = new \Datetime();
  538. foreach($this->sejourSessions as $session){
  539. if ($session->getDateDebut() > $date){
  540. $output [] = $session;
  541. }
  542. }
  543. return $output;
  544. }
  545. public function getMinFuturePrice():float
  546. {
  547. $output = 20000;
  548. $futures = $this->getFutureSejourSessions();
  549. foreach($futures as $futur){
  550. if($futur->getPrix() < $output){
  551. $output = $futur->getPrix();
  552. }
  553. }
  554. return $output;
  555. }
  556. public function getPeriode(): string
  557. {
  558. $output = "";
  559. $futures = $this->getFutureSejourSessions();
  560. $monthMin = 12;
  561. $monthMax = 1 ;
  562. foreach($futures as $futur)
  563. {
  564. if($futur->getDateDebut()->format('m')<$monthMin)
  565. $monthMin = $futur->getDateDebut()->format('m');
  566. if($futur->getDateDebut()->format('m')>$monthMax)
  567. $monthMax = $futur->getDateDebut()->format('m');
  568. }
  569. if($monthMin == $monthMax)
  570. return self::MOIS[$monthMin];
  571. return self::MOIS[$monthMin]." - ".self::MOIS[$monthMax];
  572. }
  573. public function hasFutureSejourSessions(): bool
  574. {
  575. if(count($this->getFutureSejourSessions()) > 0 ) return true;
  576. return false;
  577. }
  578. /**
  579. * @return Collection|Media[]
  580. */
  581. public function getMedias(): Collection
  582. {
  583. return $this->medias;
  584. }
  585. public function addMedia(Media $media): self
  586. {
  587. if (!$this->medias->contains($media)) {
  588. $this->medias[] = $media;
  589. $media->setSejour($this);
  590. }
  591. return $this;
  592. }
  593. public function removeMedia(Media $media): self
  594. {
  595. if ($this->medias->removeElement($media)) {
  596. // set the owning side to null (unless already changed)
  597. if ($media->getSejour() === $this) {
  598. $media->setSejour(null);
  599. }
  600. }
  601. return $this;
  602. }
  603. public function getLegacyId(): ?int
  604. {
  605. return $this->legacyId;
  606. }
  607. public function setLegacyId(?int $legacyId): self
  608. {
  609. $this->legacyId = $legacyId;
  610. return $this;
  611. }
  612. public function getIntro(): ?string
  613. {
  614. return $this->intro;
  615. }
  616. public function setIntro(?string $intro): self
  617. {
  618. $this->intro = $intro;
  619. return $this;
  620. }
  621. public function getPrice(): ?float
  622. {
  623. return $this->price;
  624. }
  625. public function setPrice(?float $price): self
  626. {
  627. $this->price = $price;
  628. return $this;
  629. }
  630. public function getDuree(): ?string
  631. {
  632. return $this->duree;
  633. }
  634. public function setDuree(?string $duree): self
  635. {
  636. $this->duree = $duree;
  637. return $this;
  638. }
  639. public function getEncadrement(): ?string
  640. {
  641. return $this->encadrement;
  642. }
  643. public function setEncadrement(?string $encadrement): self
  644. {
  645. $this->encadrement = $encadrement;
  646. return $this;
  647. }
  648. public function getNombre(): ?string
  649. {
  650. return $this->nombre;
  651. }
  652. public function setNombre(string $nombre): self
  653. {
  654. $this->nombre = $nombre;
  655. return $this;
  656. }
  657. public function getDureeInteger(): ?int
  658. {
  659. return $this->dureeInteger;
  660. }
  661. public function setDureeInteger(?int $dureeString): self
  662. {
  663. $this->dureeInteger = $dureeString;
  664. return $this;
  665. }
  666. public function getTranport(): ?string
  667. {
  668. return $this->tranport;
  669. }
  670. public function setTranport(?string $tranport): self
  671. {
  672. $this->tranport = $tranport;
  673. return $this;
  674. }
  675. public function getTransport(): ?string
  676. {
  677. return $this->transport;
  678. }
  679. public function setTransport(?string $transport): self
  680. {
  681. $this->transport = $transport;
  682. return $this;
  683. }
  684. public function getCompris(): ?string
  685. {
  686. return $this->compris;
  687. }
  688. public function setCompris(?string $compris): self
  689. {
  690. $this->compris = $compris;
  691. return $this;
  692. }
  693. public function getNoncompris(): ?string
  694. {
  695. return $this->noncompris;
  696. }
  697. public function setNoncompris(string $noncompris): self
  698. {
  699. $this->noncompris = $noncompris;
  700. return $this;
  701. }
  702. public function getInformationComplementaire(): ?string
  703. {
  704. return $this->informationComplementaire;
  705. }
  706. public function setInformationComplementaire(string $noncompris): self
  707. {
  708. $this->informationComplementaire = $noncompris;
  709. return $this;
  710. }
  711. /**
  712. * @return Collection|Property[]
  713. */
  714. public function getProperty(): Collection
  715. {
  716. return $this->property;
  717. }
  718. public function addProperty(Property $property): self
  719. {
  720. if (!$this->property->contains($property)) {
  721. $this->property[] = $property;
  722. }
  723. return $this;
  724. }
  725. public function removeProperty(Property $property): self
  726. {
  727. $this->property->removeElement($property);
  728. return $this;
  729. }
  730. /**
  731. * @return Collection|Temoignage[]
  732. */
  733. public function getTemoignages(): Collection
  734. {
  735. return $this->temoignages;
  736. }
  737. public function addTemoignage(Temoignage $temoignage): self
  738. {
  739. if (!$this->temoignages->contains($temoignage)) {
  740. $this->temoignages[] = $temoignage;
  741. $temoignage->setSejour($this);
  742. }
  743. return $this;
  744. }
  745. public function removeTemoignage(Temoignage $temoignage): self
  746. {
  747. if ($this->temoignages->removeElement($temoignage)) {
  748. // set the owning side to null (unless already changed)
  749. if ($temoignage->getSejour() === $this) {
  750. $temoignage->setSejour(null);
  751. }
  752. }
  753. return $this;
  754. }
  755. public function getSejourType(): ?string
  756. {
  757. return $this->sejourType;
  758. }
  759. public function setSejourType(?string $url): self
  760. {
  761. $this->sejourType = $url;
  762. return $this;
  763. }
  764. public function getUrl(): ?string
  765. {
  766. return $this->url;
  767. }
  768. public function setUrl(?string $url): self
  769. {
  770. $this->url = $url;
  771. return $this;
  772. }
  773. public function getAvailableplaces(): int
  774. {
  775. $output = 0 ;
  776. $sessionsfutures = $this->getFutureSejourSessions();
  777. foreach($sessionsfutures as $sf){
  778. $output += $sf->getFreePlacesNumber();
  779. }
  780. return $output;
  781. }
  782. public function getMinPrice(): int
  783. {
  784. $output = 10000 ;
  785. $sessionsfutures = $this->getFutureSejourSessions();
  786. foreach($sessionsfutures as $sf){
  787. if($sf->getPrix() < $output)
  788. $output = $sf->getPrix();
  789. }
  790. return $output;
  791. }
  792. public function getTrancheAge1(): ?TrancheAge
  793. {
  794. return $this->trancheAge1;
  795. }
  796. public function setTrancheAge1(?TrancheAge $trancheAge1): self
  797. {
  798. $this->trancheAge1 = $trancheAge1;
  799. return $this;
  800. }
  801. public function getTrancheAge2(): ?TrancheAge
  802. {
  803. return $this->trancheAge2;
  804. }
  805. public function setTrancheAge2(?TrancheAge $trancheAge2): self
  806. {
  807. $this->trancheAge2 = $trancheAge2;
  808. return $this;
  809. }
  810. public function getVideoLink(): ?string
  811. {
  812. return $this->videoLink;
  813. }
  814. public function setVideoLink(?string $videoLink): self
  815. {
  816. $this->videoLink = $videoLink;
  817. return $this;
  818. }
  819. public function getActivitesFicheSejour(): ?string
  820. {
  821. return $this->activitesFicheSejour;
  822. }
  823. public function setActivitesFicheSejour(?string $videoLink): self
  824. {
  825. $this->activitesFicheSejour = $videoLink;
  826. return $this;
  827. }
  828. public function getLienYoutube(): ?string
  829. {
  830. return $this->lienYoutube;
  831. }
  832. public function setLienYoutube(?string $lienYoutube): self
  833. {
  834. $this->lienYoutube = $lienYoutube;
  835. return $this;
  836. }
  837. public function isFutureComplete():bool{
  838. $availables = 0;
  839. foreach($this->getSejourSessions() as $session){
  840. $availables += $session->getPlaceDispo();
  841. }
  842. return $availables == 0;
  843. }
  844. public function isInWhitelist(?User $user = null): ?SejourWhitelist
  845. {
  846. if ($user){
  847. foreach ($this->whitelists as $whitelist) {
  848. if ($whitelist->getUser() === $user) {
  849. return $whitelist;
  850. }
  851. }
  852. }
  853. return null;
  854. }
  855. public function getUpdatedDate(): ?\DateTimeInterface
  856. {
  857. return $this->updatedDate;
  858. }
  859. public function setUpdatedDate(\DateTimeInterface $updatedDate): self
  860. {
  861. $this->updatedDate = $updatedDate;
  862. return $this;
  863. }
  864. }