src/Entity/SejourSession.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SejourSessionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use phpDocumentor\Reflection\Types\Boolean;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. /**
  11. * @ORM\Entity(repositoryClass=SejourSessionRepository::class)
  12. * @UniqueEntity(fields={"code"}, message="Ce code est déjà utilisé")
  13. */
  14. class SejourSession
  15. {
  16. /**
  17. * @ORM\Id
  18. * @ORM\GeneratedValue
  19. * @ORM\Column(type="integer")
  20. */
  21. private $id;
  22. /**
  23. * @ORM\Column(type="string", length=20, unique= true)
  24. */
  25. private $code;
  26. /**
  27. * @ORM\Column(type="string", length=20,nullable= true)
  28. */
  29. private $codeGen;
  30. /**
  31. * @ORM\Column(type="date")
  32. */
  33. private $dateDebut;
  34. /**
  35. * @ORM\Column(type="date")
  36. */
  37. private $dateFin;
  38. /**
  39. * @ORM\Column(type="float",nullable= true)
  40. *
  41. */
  42. private $prix;
  43. /**
  44. * @ORM\Column(type="integer")
  45. */
  46. private $placeDispo;
  47. /**
  48. * @ORM\Column(type="integer", nullable=true)
  49. */
  50. private $mediaStatut;
  51. /**
  52. * @ORM\Column(type="date", nullable=true)
  53. */
  54. private $lastUpdate;
  55. /**
  56. * @ORM\ManyToOne(targetEntity=Sejour::class, inversedBy="sejourSessions", fetch="EAGER",cascade={"persist"})
  57. * @ORM\JoinColumn(nullable=false)
  58. */
  59. private $sejour;
  60. /**
  61. * @ORM\OneToMany(targetEntity=MessageParent::class, mappedBy="sejourSession",cascade={"persist", "remove"})
  62. */
  63. private $messageParents;
  64. /**
  65. * @ORM\OneToMany(targetEntity=Inscription::class, mappedBy="sejourSession",cascade={"persist", "remove"})
  66. */
  67. private $inscriptions;
  68. /**
  69. * @ORM\OneToMany(targetEntity=Equipier::class, mappedBy="sejourSession",cascade={"persist"})
  70. */
  71. private $equipiers;
  72. /**
  73. * @ORM\OneToMany(targetEntity=SejourSessionEquipier::class, mappedBy="sejourSession",cascade={"persist", "remove"})
  74. */
  75. private $sejourSessionEquipiers;
  76. /**
  77. * @ORM\OneToMany(targetEntity=SejourSessionMajorationTransport::class, mappedBy="sejourSession",cascade={"persist", "remove"})
  78. */
  79. private $sejourSessionMajorationTransports;
  80. /**
  81. * @ORM\OneToMany(targetEntity=Media::class, mappedBy="sejourSession", cascade={"persist", "remove"})
  82. */
  83. private $medias;
  84. /**
  85. * @ORM\OneToMany(targetEntity=MessageDirecteurAuxParents::class, mappedBy="sejourSession",cascade={"persist", "remove"})
  86. * @ORM\OrderBy({"createdDate" = "DESC"})
  87. */
  88. private $messageDirecteurAuxParents;
  89. /**
  90. * @ORM\Column(type="string", length=50, nullable=true)
  91. */
  92. private $legacyId;
  93. /**
  94. * @ORM\OneToMany(targetEntity=Temoignage::class, mappedBy="sejourSession",cascade={"persist", "remove"})
  95. */
  96. private $temoignages;
  97. /**
  98. * @ORM\OneToMany(targetEntity=EnterpriseOptionSejourSession::class, mappedBy="sejourSession", cascade={"persist", "remove"})
  99. */
  100. private $enterpriseOptionSejourSessions;
  101. /**
  102. * @ORM\OneToMany(targetEntity=SejourSessionPicture::class, mappedBy="sejourSession",cascade={"persist", "remove"})
  103. * @ORM\OrderBy({"creationDate" = "DESC"})
  104. */
  105. private $sejourSessionPictures;
  106. /**
  107. * @ORM\Column(type="integer", nullable=true)
  108. */
  109. private $overridePlacesDispos;
  110. public function __construct()
  111. {
  112. $this->messageParents = new ArrayCollection();
  113. $this->inscriptions = new ArrayCollection();
  114. $this->equipiers = new ArrayCollection();
  115. $this->sejourSessionEquipiers = new ArrayCollection();
  116. $this->sejourSessionMajorationTransports = new ArrayCollection();
  117. $this->medias = new ArrayCollection();
  118. $this->messageDirecteurAuxParents = new ArrayCollection();
  119. $this->prix = 1000;
  120. $this->placeDispo = 0;
  121. $this->temoignages = new ArrayCollection();
  122. $this->enterpriseOptionSejourSessions = new ArrayCollection();
  123. $this->sejourSessionPictures = new ArrayCollection();
  124. }
  125. public function getMediaStatut():?int
  126. {
  127. return $this->mediaStatut;
  128. }
  129. public function setMediaStatut(?int $statut)
  130. {
  131. $this->mediaStatut = $statut;
  132. return $this;
  133. }
  134. public function setLastUpdate(\Datetime $date)
  135. {
  136. $this->lastUpdate = $date;
  137. return $this;
  138. }
  139. public function getLastUpdate()
  140. {
  141. return $this->lastUpdate;
  142. }
  143. public function getDirector(): ?Contact
  144. {
  145. foreach($this->getSejourSessionEquipiers() as $sse){
  146. if($sse->getMetier()->getName() == Metier::TYPE_DIRECTOR){
  147. return $sse->getContact();
  148. }
  149. }
  150. return null;
  151. }
  152. public function hasEnfant(Contact $enfant): bool
  153. {
  154. foreach($this->getInscriptions() as $inscription){
  155. if ($inscription->getEnfant() == $enfant && ($inscription->getStatut() == Inscription::PAID || $inscription->getStatut() == Inscription::PART|| $inscription->getStatut() == Inscription::OPTION) )
  156. return true;
  157. }
  158. return false;
  159. }
  160. public function getId(): ?int
  161. {
  162. return $this->id;
  163. }
  164. public function getCode(): ?string
  165. {
  166. return $this->code;
  167. }
  168. public function setCode(string $code): self
  169. {
  170. $this->code = $code;
  171. return $this;
  172. }
  173. public function getCodeGen(): ?string
  174. {
  175. return $this->code;
  176. }
  177. public function setCodeGen(string $codeGen): self
  178. {
  179. $this->codeGen = $codeGen;
  180. return $this;
  181. }
  182. public function getDateDebut(): ?\DateTimeInterface
  183. {
  184. return $this->dateDebut;
  185. }
  186. public function setDateDebut(\DateTimeInterface $dateDebut): self
  187. {
  188. $this->dateDebut = $dateDebut;
  189. return $this;
  190. }
  191. public function getDateFin(): ?\DateTimeInterface
  192. {
  193. return $this->dateFin;
  194. }
  195. public function setDateFin(\DateTimeInterface $dateFin): self
  196. {
  197. $this->dateFin = $dateFin;
  198. return $this;
  199. }
  200. public function getPrix(): ?float
  201. {
  202. return $this->prix;
  203. }
  204. public function setPrix(?float $prix): self
  205. {
  206. $this->prix = $prix;
  207. return $this;
  208. }
  209. public function getPlaceDispo(): ?int
  210. {
  211. return (int)$this->placeDispo;
  212. }
  213. public function setPlaceDispo(int $placeDispo): self
  214. {
  215. $this->placeDispo = $placeDispo;
  216. return $this;
  217. }
  218. public function getSejour(): ?Sejour
  219. {
  220. return $this->sejour;
  221. }
  222. public function setSejour(?Sejour $sejour): self
  223. {
  224. $this->sejour = $sejour;
  225. if ($sejour !== null)
  226. $this->placeDispo = $sejour->getNombre();
  227. return $this;
  228. }
  229. /**
  230. * @return Collection|MessageParent[]
  231. */
  232. public function getMessageParents(): Collection
  233. {
  234. return $this->messageParents;
  235. }
  236. public function addMessageParent(MessageParent $messageParent): self
  237. {
  238. if (!$this->messageParents->contains($messageParent)) {
  239. $this->messageParents[] = $messageParent;
  240. $messageParent->setSejourSession($this);
  241. }
  242. return $this;
  243. }
  244. public function removeMessageParent(MessageParent $messageParent): self
  245. {
  246. if ($this->messageParents->removeElement($messageParent)) {
  247. // set the owning side to null (unless already changed)
  248. if ($messageParent->getSejourSession() === $this) {
  249. $messageParent->setSejourSession(null);
  250. }
  251. }
  252. return $this;
  253. }
  254. /**
  255. * @return Collection|Inscription[]
  256. */
  257. public function getInscriptions(): Collection
  258. {
  259. return $this->inscriptions;
  260. }
  261. public function addInscription(Inscription $inscription): self
  262. {
  263. if (!$this->inscriptions->contains($inscription)) {
  264. $this->inscriptions[] = $inscription;
  265. $inscription->setSejourSession($this);
  266. }
  267. return $this;
  268. }
  269. public function removeInscription(Inscription $inscription): self
  270. {
  271. if ($this->inscriptions->removeElement($inscription)) {
  272. // set the owning side to null (unless already changed)
  273. if ($inscription->getSejourSession() === $this) {
  274. $inscription->setSejourSession(null);
  275. }
  276. }
  277. return $this;
  278. }
  279. /**
  280. * @return Collection|Equipier[]
  281. */
  282. public function getEquipiers(): Collection
  283. {
  284. return $this->equipiers;
  285. }
  286. public function addEquipier(Equipier $equipier): self
  287. {
  288. if (!$this->equipiers->contains($equipier)) {
  289. $this->equipiers[] = $equipier;
  290. $equipier->setSejourSession($this);
  291. }
  292. return $this;
  293. }
  294. public function removeEquipier(Equipier $equipier): self
  295. {
  296. if ($this->equipiers->removeElement($equipier)) {
  297. // set the owning side to null (unless already changed)
  298. if ($equipier->getSejourSession() === $this) {
  299. $equipier->setSejourSession(null);
  300. }
  301. }
  302. return $this;
  303. }
  304. /**
  305. * @return Collection|SejourSessionEquipier[]
  306. */
  307. public function getSejourSessionEquipiers(): Collection
  308. {
  309. return $this->sejourSessionEquipiers;
  310. }
  311. public function addSejourSessionEquipier(SejourSessionEquipier $sejourSessionEquipier): self
  312. {
  313. if (!$this->sejourSessionEquipiers->contains($sejourSessionEquipier)) {
  314. $this->sejourSessionEquipiers[] = $sejourSessionEquipier;
  315. $sejourSessionEquipier->setSejourSession($this);
  316. }
  317. return $this;
  318. }
  319. public function removeSejourSessionEquipier(SejourSessionEquipier $sejourSessionEquipier): self
  320. {
  321. if ($this->sejourSessionEquipiers->removeElement($sejourSessionEquipier)) {
  322. // set the owning side to null (unless already changed)
  323. if ($sejourSessionEquipier->getSejourSession() === $this) {
  324. $sejourSessionEquipier->setSejourSession(null);
  325. }
  326. }
  327. return $this;
  328. }
  329. /**
  330. * @return Collection|SejourSessionMajorationTransports[]
  331. */
  332. public function getSejourSessionMajorationTransports(): Collection
  333. {
  334. return $this->sejourSessionMajorationTransports;
  335. }
  336. public function addSejourSessionMajorationTransport(SejourSessionMajorationTransport $sejourSessionMajorationTransport): self
  337. {
  338. if (!$this->sejourSessionMajorationTransports->contains($sejourSessionMajorationTransport)) {
  339. $this->sejourSessionMajorationTransports[] = $sejourSessionMajorationTransport;
  340. $sejourSessionMajorationTransport->setSejourSession($this);
  341. }
  342. return $this;
  343. }
  344. public function removeSejourSessionMajorationTransport(SejourSessionEquipier $sejourSessionMajorationTransport): self
  345. {
  346. if ($this->sejourSessionMajorationTransports->removeElement($sejourSessionMajorationTransport)) {
  347. // set the owning side to null (unless already changed)
  348. if ($sejourSessionMajorationTransport->getSejourSession() === $this) {
  349. $sejourSessionMajorationTransport->setSejourSession(null);
  350. }
  351. }
  352. return $this;
  353. }
  354. /**
  355. * @return Collection|Media[]
  356. */
  357. public function getMedias(): Collection
  358. {
  359. return $this->medias;
  360. }
  361. public function addMedia(Media $media): self
  362. {
  363. if (!$this->medias->contains($media)) {
  364. $this->medias[] = $media;
  365. $media->setSejourSession($this);
  366. }
  367. return $this;
  368. }
  369. public function removeMedia(Media $media): self
  370. {
  371. if ($this->medias->removeElement($media)) {
  372. // set the owning side to null (unless already changed)
  373. if ($media->getSejourSession() === $this) {
  374. $media->setSejourSession(null);
  375. }
  376. }
  377. return $this;
  378. }
  379. /**
  380. * @return Collection|MessageDirecteurAuxParents[]
  381. */
  382. public function getMessageDirecteurAuxParents(): Collection
  383. {
  384. return $this->messageDirecteurAuxParents;
  385. }
  386. /**
  387. * @return Collection|MessageDirecteurAuxParents[]
  388. */
  389. public function getMessageDirecteurAuxParentsValide(): array
  390. {
  391. $output = [];
  392. foreach($this->messageDirecteurAuxParents as $message)
  393. {
  394. if ($message->getStatus() == MessageDirecteurAuxParents::STATE_VALIDATED)
  395. $output[] = $message;
  396. }
  397. return $output;
  398. }
  399. public function addMessageDirecteurAuxParent(MessageDirecteurAuxParents $messageDirecteurAuxParent): self
  400. {
  401. if (!$this->messageDirecteurAuxParents->contains($messageDirecteurAuxParent)) {
  402. $this->messageDirecteurAuxParents[] = $messageDirecteurAuxParent;
  403. $messageDirecteurAuxParent->setSejourSession($this);
  404. }
  405. return $this;
  406. }
  407. public function removeMessageDirecteurAuxParent(MessageDirecteurAuxParents $messageDirecteurAuxParent): self
  408. {
  409. if ($this->messageDirecteurAuxParents->removeElement($messageDirecteurAuxParent)) {
  410. // set the owning side to null (unless already changed)
  411. if ($messageDirecteurAuxParent->getSejourSession() === $this) {
  412. $messageDirecteurAuxParent->setSejourSession(null);
  413. }
  414. }
  415. return $this;
  416. }
  417. public function getLegacyId(): ?string
  418. {
  419. return $this->legacyId;
  420. }
  421. public function setLegacyId(?string $legacyId): self
  422. {
  423. $this->legacyId = $legacyId;
  424. return $this;
  425. }
  426. /**
  427. * @return Collection|Temoignage[]
  428. */
  429. public function getTemoignages(): Collection
  430. {
  431. return $this->temoignages;
  432. }
  433. public function addTemoignage(Temoignage $temoignage): self
  434. {
  435. if (!$this->temoignages->contains($temoignage)) {
  436. $this->temoignages[] = $temoignage;
  437. $temoignage->setSejourSession($this);
  438. }
  439. return $this;
  440. }
  441. public function removeTemoignage(Temoignage $temoignage): self
  442. {
  443. if ($this->temoignages->removeElement($temoignage)) {
  444. // set the owning side to null (unless already changed)
  445. if ($temoignage->getSejourSession() === $this) {
  446. $temoignage->setSejourSession(null);
  447. }
  448. }
  449. return $this;
  450. }
  451. /**
  452. * @return Collection|EnterpriseOptionSejourSession[]
  453. */
  454. public function getEnterpriseOptionSejourSessions(): Collection
  455. {
  456. return $this->enterpriseOptionSejourSessions;
  457. }
  458. public function addEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
  459. {
  460. if (!$this->enterpriseOptionSejourSessions->contains($enterpriseOptionSejourSession)) {
  461. $this->enterpriseOptionSejourSessions[] = $enterpriseOptionSejourSession;
  462. $enterpriseOptionSejourSession->setSejourSession($this);
  463. }
  464. return $this;
  465. }
  466. public function removeEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
  467. {
  468. if ($this->enterpriseOptionSejourSessions->removeElement($enterpriseOptionSejourSession)) {
  469. // set the owning side to null (unless already changed)
  470. if ($enterpriseOptionSejourSession->getSejourSession() === $this) {
  471. $enterpriseOptionSejourSession->setSejourSession(null);
  472. }
  473. }
  474. return $this;
  475. }
  476. /**
  477. * @return Collection|SejourSessionPicture[]
  478. */
  479. public function getSejourSessionPictures(): Collection
  480. {
  481. return $this->sejourSessionPictures;
  482. }
  483. public function addSejourSessionPicture(SejourSessionPicture $sejourSessionPicture): self
  484. {
  485. if (!$this->sejourSessionPictures->contains($sejourSessionPicture)) {
  486. $this->sejourSessionPictures[] = $sejourSessionPicture;
  487. $sejourSessionPicture->setSejourSession($this);
  488. }
  489. return $this;
  490. }
  491. public function removeSejourSessionPicture(SejourSessionPicture $sejourSessionPicture): self
  492. {
  493. if ($this->sejourSessionPictures->removeElement($sejourSessionPicture)) {
  494. // set the owning side to null (unless already changed)
  495. if ($sejourSessionPicture->getSejourSession() === $this) {
  496. $sejourSessionPicture->setSejourSession(null);
  497. }
  498. }
  499. return $this;
  500. }
  501. public function getOverridePlacesDispos(): ?int
  502. {
  503. return $this->overridePlacesDispos;
  504. }
  505. public function setOverridePlacesDispos(?int $overridePlacesDispos): self
  506. {
  507. $this->overridePlacesDispos = $overridePlacesDispos;
  508. return $this;
  509. }
  510. public function getReserved(): int
  511. {
  512. $now = new \Datetime();
  513. $count = 0;
  514. foreach($this->getEnterpriseOptionSejourSessions() as $option){
  515. if($now < $option->getEndDate() and $option->getStatut() == "validated"){
  516. $count += $option->getNbreSouhaite();
  517. }
  518. }
  519. return $count;
  520. }
  521. public function getReservedAndBooked(): int
  522. {
  523. $now = new \Datetime();
  524. $count = 0;
  525. foreach($this->inscriptions as $inscription){
  526. if(($inscription->getEnterpriseOptionSejourSession() !== null) && ($inscription->getStatut() == "option" || $inscription->getStatut() == "part"|| $inscription->getStatut() == "complete"))
  527. $count ++;
  528. }
  529. return $count;
  530. }
  531. public function getReservedBookedAndOpen(): int
  532. {
  533. $now = new \Datetime();
  534. $count = 0;
  535. foreach($this->inscriptions as $inscription){
  536. if( ($inscription->getEnterpriseOptionSejourSession() !== null) &&($inscription->getEnterpriseOptionSejourSession()->getEndDate() > $now) &&($inscription->getStatut() == "option" || $inscription->getStatut() == "part"|| $inscription->getStatut() == "complete") )
  537. $count ++;
  538. }
  539. return $count;
  540. }
  541. public function getCodeComplet(): string
  542. {
  543. return $this->getCode() . " - " . $this->getSejour()->getTitle()." - ".$this->getDateDebut()->format('d/m/Y') ;
  544. }
  545. public function getOpen(): int
  546. {
  547. $now = new \Datetime();
  548. $count = 0;
  549. foreach($this->getInscriptions() as $inscription){
  550. if (($inscription->getStatut() == Inscription::OPEN) && $inscription->getEnterpriseOptionSejourSession()==null )
  551. $count ++;
  552. }
  553. return $count;
  554. }
  555. public function getPaid(): int
  556. {
  557. $now = new \Datetime();
  558. $count = 0;
  559. foreach($this->getInscriptions() as $inscription){
  560. if (( $inscription->getStatut() == Inscription::PAID ) && $inscription->getEnterpriseOptionSejourSession()==null )
  561. $count ++;
  562. }
  563. return $count;
  564. }
  565. public function getPart(): int
  566. {
  567. $now = new \Datetime();
  568. $count = 0;
  569. foreach($this->getInscriptions() as $inscription){
  570. if (( $inscription->getStatut() == Inscription::PART ) && $inscription->getEnterpriseOptionSejourSession()==null )
  571. $count ++;
  572. }
  573. return $count;
  574. }
  575. public function getInscritsCount3():int
  576. {
  577. $count = 0;
  578. foreach($this->getInscriptions() as $inscription){
  579. if (($inscription->getStatut() == Inscription::PAID || $inscription->getStatut() == Inscription::PART) )
  580. $count ++;
  581. }
  582. if($this->getOverridePlacesDispos() === 1 && $count>0)
  583. return 1;
  584. return $count;
  585. }
  586. public function getInscritsCount2():int
  587. {
  588. $count = 0;
  589. foreach($this->getInscriptions() as $inscription){
  590. if (($inscription->getStatut() == Inscription::PAID || $inscription->getStatut() == Inscription::PART || $inscription->getStatut() == Inscription::OPEN) )
  591. $count ++;
  592. }
  593. if($this->getOverridePlacesDispos() === 1 && $count>0)
  594. return 1;
  595. return $count;
  596. }
  597. public function getInscritsCount():int
  598. {
  599. $count = 0;
  600. foreach($this->getInscriptions() as $inscription){
  601. if (($inscription->getStatut() == Inscription::PAID || $inscription->getStatut() == Inscription::PART || $inscription->getStatut() == Inscription::OPEN) && $inscription->getEnterpriseOptionSejourSession()==null )
  602. $count ++;
  603. }
  604. if($this->getOverridePlacesDispos() === 1 && $count>0)
  605. return 1;
  606. return $count;
  607. }
  608. public function getOptionOuvertes():int
  609. {
  610. $count = 0;
  611. $now = new \Datetime();
  612. foreach($this->getEnterpriseOptionSejourSessions() as $option){
  613. if($now < $option->getEndDate() and $option->getStatut()=="validated"){
  614. $count += $option->getNbreSouhaite();
  615. $count += - count($option->getInscriptionsValides());
  616. }
  617. }
  618. return $count;
  619. }
  620. public function getNonPayees():int
  621. {
  622. $count = 0;
  623. foreach($this->getInscriptions() as $inscription){
  624. if (($inscription->getStatut() == Inscription::OPEN) && $inscription->getEnterpriseOptionSejourSession()==null )
  625. $count ++;
  626. }
  627. if($this->getOverridePlacesDispos() === 1 && $count>0)
  628. return 1;
  629. return $count;
  630. }
  631. public function getFreePlacesNumber(): int
  632. {
  633. if($this->getOverridePlacesDispos() === 0)
  634. return 0;
  635. $count = $this->getPlaceDispo();
  636. foreach($this->getInscriptions() as $inscription){
  637. if (($inscription->getStatut() == Inscription::PAID || $inscription->getStatut() == Inscription::PART || $inscription->getStatut() == 'option'|| $inscription->getStatut() == 'open') )
  638. $count --;
  639. }
  640. //var_dump($this->getPlaceDispo());
  641. //var_dump($count);
  642. $now = new \Datetime();
  643. foreach($this->getEnterpriseOptionSejourSessions() as $option){
  644. if($now < $option->getEndDate() && $option->getStatut()=="validated"){
  645. $count += - $option->getNbreSouhaite();
  646. $count += count($option->getInscriptionsValides());
  647. }
  648. }
  649. if($this->getOverridePlacesDispos() === 1 && $count>0)
  650. return 1;
  651. return $count;
  652. }
  653. public function getFreePlacesCountWithoutReserved(): int
  654. {
  655. if($this->getOverridePlacesDispos() === 0)
  656. return 0;
  657. $count = $this->getPlaceDispo();
  658. foreach($this->getInscriptions() as $inscription){
  659. if (($inscription->getStatut() == Inscription::PAID || $inscription->getStatut() == Inscription::PART || $inscription->getStatut() == Inscription::OPEN|| $inscription->getStatut() == Inscription::OPTION) && $inscription->getEnterpriseOptionSejourSession()==null )
  660. $count --;
  661. }
  662. if($this->getOverridePlacesDispos() === 1 && $count>0)
  663. return 1;
  664. return $count;
  665. }
  666. public function isComplete(): bool
  667. {
  668. $count = $this->getFreePlacesNumber();
  669. return $count <= 0;;
  670. }
  671. }