src/Entity/Booking.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use DateTimeImmutable;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Repository\BookingRepository;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(repositoryClassBookingRepository::class)]
  9. #[ORM\HasLifecycleCallbacks]
  10. class Booking
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type"integer")]
  15.     private int $id;
  16.     #[ORM\Column(type"string"length255)]
  17.     #[Assert\NotBlank]
  18.     private string $firstName;
  19.     #[ORM\Column(type"string"length255)]
  20.     #[Assert\NotBlank]
  21.     private string $lastName;
  22.     #[ORM\Column(type"string"length255)]
  23.     #[Assert\NotBlank]
  24.     private string $email;
  25.     #[ORM\Column(type"string"length255)]
  26.     #[Assert\NotBlank]
  27.     private string $phone;
  28.     #[ORM\Column(type"string"length255)]
  29.     #[Assert\NotBlank]
  30.     private string $gender;
  31.     #[ORM\Column(type"boolean")]
  32.     private bool $approval;
  33.     #[ORM\Column(type"boolean")]
  34.     private bool $rgpd;
  35.     #[ORM\Column(type"string"length255)]
  36.     #[Assert\NotBlank]
  37.     private string $paymentMethod;
  38.     #[ORM\Column(type"datetime_immutable")]
  39.     private DateTimeImmutable $createdAt;
  40.     #[ORM\Column(type"text"nullabletrue)]
  41.     private ?string $comment null;
  42.     #[ORM\Column(type"integer")]
  43.     #[Assert\NotBlank]
  44.     private int $number;
  45.     #[ORM\Column(type"datetime")]
  46.     #[Assert\NotBlank]
  47.     #[Assert\GreaterThan("today"message"La date d'arrivée doit être ultèrieur à la date d'aujourd'hui"groups: ["front"])]
  48.     private DateTime $startDate;
  49.     #[ORM\Column(type"datetime")]
  50.     #[Assert\NotBlank]
  51.     private DateTime $endDate;
  52.     #[ORM\Column(type"float")]
  53.     private float $amount;
  54.     #[ORM\ManyToOne(targetEntityBookingConstraint::class, inversedBy"bookings")]
  55.     #[ORM\JoinColumn(nullablefalse)]
  56.     private BookingConstraint $bookingConstraint;
  57.     #[ORM\Column(type"string")]
  58.     private string $uniqId;
  59.     #[ORM\Column(type"float")]
  60.     private float $deposit;
  61.     #[ORM\Column(type"float"nullabletrue)]
  62.     private ?float $discount null;
  63.     #[ORM\Column(type"boolean"nullabletrue)]
  64.     private ?bool $isAdvancePayed null;
  65.     #[ORM\Column(type"boolean"nullabletrue)]
  66.     private ?bool $isBalancePayed null;
  67.     #[ORM\Column(type"datetime")]
  68.     private DateTime $balancePaymentDeadline;
  69.     #[ORM\Column(type"float"nullabletrue)]
  70.     private ?float $advancePayment null;
  71.     #[ORM\Column(type"datetime")]
  72.     private DateTime $advancePaymentDeadline;
  73.     #[ORM\Column(type"string"length2nullabletrue)]
  74.     private $locale;
  75.     #[ORM\Column(type"boolean"nullabletrue)]
  76.     private $isAdvancePaymentAlert1;
  77.     #[ORM\Column(type"boolean"nullabletrue)]
  78.     private $isAdvancePaymentAlert2;
  79.     #[ORM\Column(type"boolean"nullabletrue)]
  80.     private $isBalancePaymentAlert1;
  81.     #[ORM\Column(type"boolean"nullabletrue)]
  82.     private $isBalancePaymentAlert2;
  83.     #[ORM\Column(type"boolean"nullabletrue)]
  84.     private $isForSoon;
  85.     #[ORM\Column(type"boolean")]
  86.     private $tracking;
  87.     #[ORM\Column(type"boolean"nullabletrue)]
  88.     private $isCautionPayed;
  89.     #[ORM\Column(type"datetime"nullabletrue)]
  90.     private $cautionPaymentDeadline;
  91.     #[ORM\Column(type"boolean"nullabletrue)]
  92.     private $isCautionPaymentAlert1;
  93.     #[ORM\Column(type"boolean"nullabletrue)]
  94.     private $isCautionPaymentAlert2;
  95.     #[ORM\Column(type"float")]
  96.     private $stayTax;
  97.     #[ORM\Column(type"float"nullabletrue)]
  98.     private $housework null;
  99.     #[ORM\Column(type"float")]
  100.     private $finalAmount;
  101.     #[ORM\Column(type"float")]
  102.     private $dayPrice;
  103.     #[ORM\Column(type"float")]
  104.     private $dayPriceWithTax;
  105.     #[ORM\Column(type"string"length255)]
  106.     private $contract;
  107.     #[ORM\Column(type"string"length255nullabletrue)]
  108.     private $swiklyRequestId;
  109.     #[ORM\Column(type"text"nullabletrue)]
  110.     private $swiklyUrl;
  111.     #[ORM\Column(type"integer"nullabletrue)]
  112.     private $children;
  113.     /**
  114.      * Callback appelé à chaque fois qu'on fait un reservation
  115.      * 
  116.      * Ajoute une date
  117.      * Calcul et ajoute le prix de la reservation avant ménage, tax et éventuelle réduction
  118.      * Calcul et ajoute le prix total de la reservation
  119.      * Calcul et ajoute le prix de la tax de séjour
  120.      * Calcul et ajoute le prix du ménage
  121.      * Calcul et ajoute le prix de l'acompte
  122.      *
  123.      * @return void
  124.      */
  125.     #[ORM\PrePersist]
  126.     #[ORM\PreUpdate]
  127.     public function prePersist()
  128.     {
  129.         if (empty($this->createdAt)) {
  130.             $this->createdAt = new \DateTimeImmutable();
  131.         }
  132.         if (empty($this->amount)) {
  133.             $this->amount = ($this->getPrice() * $this->getDuration()) * 100;
  134.         }
  135.         if (empty($this->stayTax)) {
  136.             $this->stayTax ceil(($this->bookingConstraint->getStayTax() / 100) * $this->getDuration() * ($this->getNumber() - $this->getChildren())) * 100;
  137.         }
  138.         if (empty($this->housework)) {
  139.             $this->housework $this->bookingConstraint->getHousework();
  140.         }
  141.         if (empty($this->finalAmount)) {
  142.             $this->finalAmount $this->getTotalAmount() * 100;
  143.         }
  144.         if (empty($this->dayPrice)) {
  145.             $this->dayPrice $this->getPrice() * 100;
  146.         }
  147.         if (empty($this->dayPriceWithTax)) {
  148.             $this->dayPriceWithTax ceil(($this->getTotalAmount() * 100) / $this->getDuration());
  149.         }
  150.         if (empty($this->advancePayment)) {
  151.             if ($this->isForSoon != true) {
  152.                 $this->advancePayment ceil($this->getFinalAmount() * $this->bookingConstraint->getAdvancePayment());
  153.             } else {
  154.                 $this->advancePayment null;
  155.             }
  156.         }
  157.     }
  158.     /**
  159.      * Permet de calculer le montant total TTC/TCC de la réservation
  160.      * 
  161.      * @return float
  162.      */
  163.     public function getTotalAmount()
  164.     {
  165.         #   On vérifie si la taxe de ménage existe
  166.         $housework 0;
  167.         if ($this->bookingConstraint->getHousework() > 0) {
  168.             $housework $this->bookingConstraint->getHousework() / 100;
  169.         }
  170.         #   Ajouter la réduction pour long séjour si elle existe
  171.         if ($this->getDuration() >= && $this->bookingConstraint->getLongStayDiscount() > 0) {
  172.             return ceil(($this->getPrice() * $this->getDuration()) / ($this->bookingConstraint->getLongStayDiscount()) + $housework + ($this->getStayTax() / 100));
  173.         }
  174.         # Sinon
  175.         return ($this->getPrice() * $this->getDuration()) + $housework + ($this->getStayTax() / 100);
  176.     }
  177.     /**
  178.      * Permet de calculer le montant de l'acompte
  179.      * 
  180.      * @return float|null
  181.      */
  182.     public function getAdvanceAmount()
  183.     {
  184.         return null;
  185.     }
  186.     /**
  187.      * Permet de calculer la durée du séjour
  188.      */
  189.     public function getDuration()
  190.     {
  191.         $diff $this->endDate->diff($this->startDate);
  192.         return $diff->days;
  193.     }
  194.     /**
  195.      * Permet de déterminer si un jour et disponible à la réservation
  196.      *
  197.      * @return boolean
  198.      */
  199.     public function isBookableDates()
  200.     {
  201.         #   1) il faut connaitre les dates qui sont impossible pour l'annonce
  202.         $notAvailableDays $this->bookingConstraint->getNotAvailableDays();
  203.         #   2) il faut comparer avec les dates choisies
  204.         $bookingDays $this->getDays();
  205.         #   Fonction pour formater les jours
  206.         $formatDays = function ($day) {
  207.             return $day->format('Y-m-d');
  208.         };
  209.         #   Tableau des strings de mes journées à reserver
  210.         $daysToReserve array_map($formatDays$bookingDays);
  211.         #   Tableau des strings de mes journées non disponibles
  212.         $notAvailable array_map($formatDays$notAvailableDays);
  213.         #  Pour chaques journeés à reserver je regarde si elle se trouve dans les journées non disponibles
  214.         foreach ($daysToReserve as $day) {
  215.             if (array_search($day$notAvailable) !== false) {
  216.                 return false;
  217.             } else {
  218.                 return true;
  219.             }
  220.         }
  221.     }
  222.     /**
  223.      * Permet de récupérer un tableau des journées qui correspondent à ma reservation
  224.      *
  225.      * @return array Un tableau d'objets DateTime représentant les jours de la reservation
  226.      */
  227.     public function getDays()
  228.     {
  229.         $resultat range(
  230.             $this->startDate->getTimestamp(),
  231.             $this->endDate->getTimestamp(),
  232.             24 60 60
  233.         );
  234.         $days array_map(function ($dayTimestamp) {
  235.             return new \DateTime(date('Y-m-d'$dayTimestamp));
  236.         }, $resultat);
  237.         return $days;
  238.     }
  239.     /**
  240.      * Permet de récupérer le prix par nuits en fonction de la saison
  241.      *
  242.      * @return int
  243.      */
  244.     public function getPrice()
  245.     {
  246.         $saisons $this->getSaison();
  247.         $saisonConstraints $this->getBookingConstraint()->getSaisons();
  248.         $temp = [];
  249.         $temp['count'] = 0;
  250.         $temp['price'] = 0;
  251.         foreach ($saisonConstraints as $saisonConstraint) {
  252.             foreach ($saisons as $key => $saison) {
  253.                 #   On récupère les saisons dans les quelles on se trouve 
  254.                 if ($saisonConstraint->translate('fr')->getTitle() == $saison['saison']) {
  255.                     #   On incrémente le prix et le nombre de jour à chaque boucle
  256.                     $temp['count'] += 1;
  257.                     $temp['price'] += $saisonConstraint->getPrice();
  258.                 }
  259.             }
  260.         }
  261.         $mediumPrice ceil($temp['price'] / $temp['count']);
  262.         return $mediumPrice;
  263.     }
  264.     /**
  265.      * Fonction de récupération de la saison du séjour 
  266.      *
  267.      * @return array Un tableau de jour avec la saison a laquelle ils appartiennent
  268.      */
  269.     private function getSaison()
  270.     {
  271.         $saisons $this->bookingConstraint->getSaisons();
  272.         $periods_days = [];
  273.         foreach ($saisons as $key => $saison) {
  274.             foreach ($saison->getPeriods() as $key => $period) {
  275.                 $resultat range(
  276.                     $period->getStartDate()->getTimestamp(),
  277.                     $period->getEndDate()->getTimestamp(),
  278.                     24 60 60
  279.                 );
  280.                 $days array_map(function ($dayTimestamp) {
  281.                     return new \DateTime(date('Y-m-d'$dayTimestamp));
  282.                 }, $resultat);
  283.                 $periods_days[$saison->translate('fr')->getTitle()][$key] = $days;
  284.             }
  285.         }
  286.         $bookingDays $this->getDays();
  287.         $formatDays = function ($day) {
  288.             return $day->format('Y-m-d');
  289.         };
  290.         #   Tableau des strings de mes journées à reserver
  291.         $daysToReserve array_map($formatDays$bookingDays);
  292.         #   Tableau des jours des diférentes saisons
  293.         foreach ($periods_days as $saison_key => $array) {
  294.             foreach ($array as $key => $item) {
  295.                 $saisonsDays[$saison_key][$key] = array_map($formatDays$item);
  296.             }
  297.         }
  298.         #   Pour chaques journées à reserver je regarde si elle se trouve dans les journées d'une saison
  299.         $temp = [];
  300.         foreach ($daysToReserve as $day) {
  301.             foreach ($saisonsDays as $saison_key => $saison) {
  302.                 foreach ($saison as $key => $item) {
  303.                     if (array_search($day$item) !== false) {
  304.                         $temp[] = [
  305.                             'day' => $day,
  306.                             'saison' => $saison_key,
  307.                         ];
  308.                     }
  309.                 }
  310.             }
  311.         }
  312.         return $temp;
  313.     }
  314.     public function getId(): ?int
  315.     {
  316.         return $this->id;
  317.     }
  318.     public function getFirstName(): ?string
  319.     {
  320.         return $this->firstName;
  321.     }
  322.     public function setFirstName(string $firstName): self
  323.     {
  324.         $this->firstName $firstName;
  325.         return $this;
  326.     }
  327.     public function getLastName(): ?string
  328.     {
  329.         return $this->lastName;
  330.     }
  331.     public function setLastName(string $lastName): self
  332.     {
  333.         $this->lastName $lastName;
  334.         return $this;
  335.     }
  336.     public function getEmail(): ?string
  337.     {
  338.         return $this->email;
  339.     }
  340.     public function setEmail(string $email): self
  341.     {
  342.         $this->email $email;
  343.         return $this;
  344.     }
  345.     public function getPhone(): ?string
  346.     {
  347.         return $this->phone;
  348.     }
  349.     public function setPhone(string $phone): self
  350.     {
  351.         $this->phone $phone;
  352.         return $this;
  353.     }
  354.     public function getGender(): ?string
  355.     {
  356.         return $this->gender;
  357.     }
  358.     public function setGender(string $gender): self
  359.     {
  360.         $this->gender $gender;
  361.         return $this;
  362.     }
  363.     public function getApproval(): ?bool
  364.     {
  365.         return $this->approval;
  366.     }
  367.     public function setApproval(bool $approval): self
  368.     {
  369.         $this->approval $approval;
  370.         return $this;
  371.     }
  372.     public function getRgpd(): ?bool
  373.     {
  374.         return $this->rgpd;
  375.     }
  376.     public function setRgpd(bool $rgpd): self
  377.     {
  378.         $this->rgpd $rgpd;
  379.         return $this;
  380.     }
  381.     public function getPaymentMethod(): ?string
  382.     {
  383.         return $this->paymentMethod;
  384.     }
  385.     public function setPaymentMethod(string $paymentMethod): self
  386.     {
  387.         $this->paymentMethod $paymentMethod;
  388.         return $this;
  389.     }
  390.     public function getCreatedAt(): ?\DateTimeImmutable
  391.     {
  392.         return $this->createdAt;
  393.     }
  394.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  395.     {
  396.         $this->createdAt $createdAt;
  397.         return $this;
  398.     }
  399.     public function getComment(): ?string
  400.     {
  401.         return $this->comment;
  402.     }
  403.     public function setComment(string $comment): self
  404.     {
  405.         $this->comment $comment;
  406.         return $this;
  407.     }
  408.     public function getNumber(): ?int
  409.     {
  410.         return $this->number;
  411.     }
  412.     public function setNumber(int $number): self
  413.     {
  414.         $this->number $number;
  415.         return $this;
  416.     }
  417.     public function getStartDate()
  418.     {
  419.         return $this->startDate;
  420.     }
  421.     public function setStartDate($startDate): self
  422.     {
  423.         $this->startDate $startDate;
  424.         return $this;
  425.     }
  426.     public function getEndDate()
  427.     {
  428.         return $this->endDate;
  429.     }
  430.     public function setEndDate($endDate): self
  431.     {
  432.         $this->endDate $endDate;
  433.         return $this;
  434.     }
  435.     public function getAmount(): ?float
  436.     {
  437.         return $this->amount;
  438.     }
  439.     public function setAmount(float $amount): self
  440.     {
  441.         $this->amount $amount;
  442.         return $this;
  443.     }
  444.     public function getBookingConstraint(): ?BookingConstraint
  445.     {
  446.         return $this->bookingConstraint;
  447.     }
  448.     public function setBookingConstraint(?BookingConstraint $bookingConstraint): self
  449.     {
  450.         $this->bookingConstraint $bookingConstraint;
  451.         return $this;
  452.     }
  453.     public function getUniqId(): ?string
  454.     {
  455.         return $this->uniqId;
  456.     }
  457.     public function setUniqId(string $uniqId): self
  458.     {
  459.         $this->uniqId $uniqId;
  460.         return $this;
  461.     }
  462.     public function getDeposit(): ?int
  463.     {
  464.         return $this->deposit;
  465.     }
  466.     public function setDeposit(int $deposit): self
  467.     {
  468.         $this->deposit $deposit;
  469.         return $this;
  470.     }
  471.     public function getDiscount(): ?float
  472.     {
  473.         return $this->discount;
  474.     }
  475.     public function setDiscount(?float $discount): self
  476.     {
  477.         $this->discount $discount;
  478.         return $this;
  479.     }
  480.     public function getIsAdvancePayed(): ?bool
  481.     {
  482.         return $this->isAdvancePayed;
  483.     }
  484.     public function setIsAdvancePayed(?bool $isAdvancePayed): self
  485.     {
  486.         $this->isAdvancePayed $isAdvancePayed;
  487.         return $this;
  488.     }
  489.     public function getIsBalancePayed(): ?bool
  490.     {
  491.         return $this->isBalancePayed;
  492.     }
  493.     public function setIsBalancePayed(?bool $isBalancePayed): self
  494.     {
  495.         $this->isBalancePayed $isBalancePayed;
  496.         return $this;
  497.     }
  498.     public function getAdvancePayment(): ?float
  499.     {
  500.         return $this->advancePayment;
  501.     }
  502.     public function setAdvancePayment(float $advancePayment): self
  503.     {
  504.         $this->advancePayment $advancePayment;
  505.         return $this;
  506.     }
  507.     public function getBalancePaymentDeadline(): ?\DateTimeInterface
  508.     {
  509.         return $this->balancePaymentDeadline;
  510.     }
  511.     public function setBalancePaymentDeadline(\DateTimeInterface $balancePaymentDeadline): self
  512.     {
  513.         $this->balancePaymentDeadline $balancePaymentDeadline;
  514.         return $this;
  515.     }
  516.     public function getAdvancePaymentDeadline(): ?\DateTimeInterface
  517.     {
  518.         return $this->advancePaymentDeadline;
  519.     }
  520.     public function setAdvancePaymentDeadline(\DateTimeInterface $advancePaymentDeadline): self
  521.     {
  522.         $this->advancePaymentDeadline $advancePaymentDeadline;
  523.         return $this;
  524.     }
  525.     public function getLocale(): ?string
  526.     {
  527.         return $this->locale;
  528.     }
  529.     public function setLocale(?string $locale): self
  530.     {
  531.         $this->locale $locale;
  532.         return $this;
  533.     }
  534.     public function getIsAdvancePaymentAlert1(): ?bool
  535.     {
  536.         return $this->isAdvancePaymentAlert1;
  537.     }
  538.     public function setIsAdvancePaymentAlert1(?bool $isAdvancePaymentAlert1): self
  539.     {
  540.         $this->isAdvancePaymentAlert1 $isAdvancePaymentAlert1;
  541.         return $this;
  542.     }
  543.     public function getIsAdvancePaymentAlert2(): ?bool
  544.     {
  545.         return $this->isAdvancePaymentAlert2;
  546.     }
  547.     public function setIsAdvancePaymentAlert2(?bool $isAdvancePaymentAlert2): self
  548.     {
  549.         $this->isAdvancePaymentAlert2 $isAdvancePaymentAlert2;
  550.         return $this;
  551.     }
  552.     public function getIsBalancePaymentAlert1(): ?bool
  553.     {
  554.         return $this->isBalancePaymentAlert1;
  555.     }
  556.     public function setIsBalancePaymentAlert1(?bool $isBalancePaymentAlert1): self
  557.     {
  558.         $this->isBalancePaymentAlert1 $isBalancePaymentAlert1;
  559.         return $this;
  560.     }
  561.     public function getIsBalancePaymentAlert2(): ?bool
  562.     {
  563.         return $this->isBalancePaymentAlert2;
  564.     }
  565.     public function setIsBalancePaymentAlert2(?bool $isBalancePaymentAlert2): self
  566.     {
  567.         $this->isBalancePaymentAlert2 $isBalancePaymentAlert2;
  568.         return $this;
  569.     }
  570.     public function getIsForSoon(): ?bool
  571.     {
  572.         return $this->isForSoon;
  573.     }
  574.     public function setIsForSoon(?bool $isForSoon): self
  575.     {
  576.         $this->isForSoon $isForSoon;
  577.         return $this;
  578.     }
  579.     public function getTracking(): ?bool
  580.     {
  581.         return $this->tracking;
  582.     }
  583.     public function setTracking(bool $tracking): self
  584.     {
  585.         $this->tracking $tracking;
  586.         return $this;
  587.     }
  588.     public function getIsCautionPayed(): ?bool
  589.     {
  590.         return $this->isCautionPayed;
  591.     }
  592.     public function setIsCautionPayed(bool $isCautionPayed): self
  593.     {
  594.         $this->isCautionPayed $isCautionPayed;
  595.         return $this;
  596.     }
  597.     public function getCautionPaymentDeadline(): ?\DateTimeInterface
  598.     {
  599.         return $this->cautionPaymentDeadline;
  600.     }
  601.     public function setCautionPaymentDeadline(\DateTimeInterface $cautionPaymentDeadline): self
  602.     {
  603.         $this->cautionPaymentDeadline $cautionPaymentDeadline;
  604.         return $this;
  605.     }
  606.     public function getIsCautionPaymentAlert1(): ?bool
  607.     {
  608.         return $this->isCautionPaymentAlert1;
  609.     }
  610.     public function setIsCautionPaymentAlert1(?bool $isCautionPaymentAlert1): self
  611.     {
  612.         $this->isCautionPaymentAlert1 $isCautionPaymentAlert1;
  613.         return $this;
  614.     }
  615.     public function getIsCautionPaymentAlert2(): ?bool
  616.     {
  617.         return $this->isCautionPaymentAlert2;
  618.     }
  619.     public function setIsCautionPaymentAlert2(?bool $isCautionPaymentAlert2): self
  620.     {
  621.         $this->isCautionPaymentAlert2 $isCautionPaymentAlert2;
  622.         return $this;
  623.     }
  624.     public function getStayTax(): ?float
  625.     {
  626.         return $this->stayTax;
  627.     }
  628.     public function setStayTax(float $stayTax): self
  629.     {
  630.         $this->stayTax $stayTax;
  631.         return $this;
  632.     }
  633.     public function getHousework(): ?float
  634.     {
  635.         return $this->housework;
  636.     }
  637.     public function setHousework(?float $housework): self
  638.     {
  639.         $this->housework $housework;
  640.         return $this;
  641.     }
  642.     public function getFinalAmount(): ?float
  643.     {
  644.         return $this->finalAmount;
  645.     }
  646.     public function setFinalAmount(float $finalAmount): self
  647.     {
  648.         $this->finalAmount $finalAmount;
  649.         return $this;
  650.     }
  651.     public function getDayPrice(): ?float
  652.     {
  653.         return $this->dayPrice;
  654.     }
  655.     public function setDayPrice(float $dayPrice): self
  656.     {
  657.         $this->dayPrice $dayPrice;
  658.         return $this;
  659.     }
  660.     public function getDayPriceWithTax(): ?float
  661.     {
  662.         return $this->dayPriceWithTax;
  663.     }
  664.     public function setDayPriceWithTax(float $dayPriceWithTax): self
  665.     {
  666.         $this->dayPriceWithTax $dayPriceWithTax;
  667.         return $this;
  668.     }
  669.     public function getContract(): ?string
  670.     {
  671.         return $this->contract;
  672.     }
  673.     public function setContract(string $contract): self
  674.     {
  675.         $this->contract $contract;
  676.         return $this;
  677.     }
  678.     public function getChildren(): ?int
  679.     {
  680.         return $this->children;
  681.     }
  682.     public function setChildren(?int $children): self
  683.     {
  684.         $this->children $children;
  685.         return $this;
  686.     }
  687.     public function getSwiklyRequestId(): ?string
  688.     {
  689.         return $this->swiklyRequestId;
  690.     }
  691.     public function setSwiklyRequestId(?string $swiklyRequestId): self
  692.     {
  693.         $this->swiklyRequestId $swiklyRequestId;
  694.         return $this;
  695.     }
  696.     public function getSwiklyUrl(): ?string
  697.     {
  698.         return $this->swiklyUrl;
  699.     }
  700.     public function setSwiklyUrl(?string $swiklyUrl): self
  701.     {
  702.         $this->swiklyUrl $swiklyUrl;
  703.         return $this;
  704.     }
  705. }