src/Entity/Residence/Occupancy.php line 1439

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Residence;
  3. use App\Service\Residence\ResidenceReportingService;
  4. use Symfony\Component\Uid\Ulid;
  5. class Occupancy implements \Serializable\JsonSerializable
  6. {
  7.     function __construct($data=null){
  8. //        dump($data);
  9.         if(!empty($data)) {
  10. //            dd('l');
  11.             $this->__unserialize($data);
  12.         }
  13.     }
  14.     private $bedId;
  15.     private ?Ulid $bedUuid;
  16.     private $bedName;
  17.     private $bedRate;
  18.     private $bedOccupancyStatus;
  19.     private $bedStatus;
  20.     private $bedType;
  21.     private ?bool $bedForCamper=null;
  22.     private bool $bedClosedFlag=false;
  23.     private $roomStatus;
  24.     private $roomType;
  25.     private $roomBathType;
  26.     private $bedOccupant;
  27.     private $bookingId=null;
  28.     private ?Ulid $bookingUuid null;
  29.     private $bookingStudent=null;
  30.     private $bookingRateCharged null;
  31.     private ?\DateTimeInterface $bookingReservationStartDate=null;
  32.     private ?\DateTimeInterface $bookingReservationEndDate=null;
  33.     private ?\DateTimeInterface $bookingCheckInDate null;
  34.     private ?\DateTimeInterface $bookingCheckOutDate null;
  35.     private ?\DateTimeInterface $bookingExpectedCheckInDate null;
  36.     private ?\DateTimeInterface $bookingExpectedCheckOutDate null;
  37.     private ?\DateTimeInterface $bookingTemporaryCheckOutDate null;
  38.     private ?\DateTimeInterface $bookingBillingStartDate null;
  39.     private ?\DateTimeInterface $bookingBillingEndDate null;
  40.     private ?bool $bookingFlagBillingReview null;
  41.     private ?string $bookingInvoiceNumber null;
  42.     private $bookingStatus 'new';
  43.     private $bookingStatusText 0;
  44.     private $bedMailbox;
  45.     private $roomAccessKey;
  46.     private $buildingAccessKey;
  47.     private $roomPhoneExtension;
  48.     private $buildingId=null;
  49.     private ?Ulid $buildingUuid null;
  50.     private $buildingName=null;
  51.     private $buildingCode=null;
  52.     private $roomId=null;
  53.     private ?Ulid $roomUuid null;
  54.     private $roomName=null;
  55.     private $floorId=null;
  56.     private ?Ulid $floorUuid null;
  57.     private $floorName=null;
  58.     private $wingmId=null;
  59.     private ?Ulid $wingUuid null;
  60.     private $wingName=null;
  61.     private $occupantId=null;
  62.     private ?Ulid $occupantUuid=null;
  63.     private $occupantNumber=null;
  64.     private $occupantGivenName=null;
  65.     private $occupantLastName=null;
  66.     private $occupantEmail=null;
  67.     private $occupantPhone=null;
  68.     private $occupantGender=null;
  69.     private $occupantType=null;
  70.     private bool $occupantYouthFlag;
  71.     private $occupantProgram;
  72.     private $occupantGroup;
  73.     private ?\DateTimeInterface $occupantDateOfBirth=null;
  74.     private $occupantCountry=null;
  75.     private $occupantBirthCountry=null;
  76.     private bool $potentialGraduateFlag;
  77.     private string $potentialGraduateSem;
  78.     private bool $graduatedFlag;
  79.     private ?int $studentId=null;
  80.     private ?Ulid $studentUuid=null;
  81.     private ?int $camperId=null;
  82.     private ?Ulid $camperUuid=null;
  83.     private ?string $overStayFlag=null;
  84.     private array $extra=[];
  85.     private $previousBookingIdnull;
  86.     private ?Ulid $previousBookingUuidnull;
  87.     private $previousBookingBedName=null;
  88.     private ?\DateTimeInterface $previousBookingCheckInDate null;
  89.     private ?\DateTimeInterface $previousBookingCheckOutDate null;
  90.     private $nextBookingIdnull;
  91.     private ?Ulid $nextBookingUuidnull;
  92.     private $nextBookingBedName=null;
  93.     private ?\DateTimeInterface $nextBookingCheckInDate null;
  94.     private ?\DateTimeInterface $nextBookingCheckOutDate null;
  95.     /**
  96.      * @return mixed
  97.      */
  98.     public function getBedId()
  99.     {
  100.         return $this->bedId;
  101.     }
  102.     /**
  103.      * @param mixed $bedId
  104.      *
  105.      * @return Occupancy
  106.      */
  107.     public function setBedId($bedId)
  108.     {
  109.         $this->bedId $bedId;
  110.         return $this;
  111.     }
  112.     /**
  113.      * @return mixed
  114.      */
  115.     public function getBedName()
  116.     {
  117.         return $this->bedName;
  118.     }
  119.     /**
  120.      * @return mixed
  121.      */
  122.     public function getBedType()
  123.     {
  124.         return $this->bedType;
  125.     }
  126.     /**
  127.      * @param mixed $bedType
  128.      * @return Occupancy
  129.      */
  130.     public function setBedType($bedType)
  131.     {
  132.         $this->bedType $bedType;
  133.         return $this;
  134.     }
  135.     public function getBedForCamper(): ?bool
  136.     {
  137.         return $this->bedForCamper;
  138.     }
  139.     public function setBedForCamper(?bool $bedForCamper): Occupancy
  140.     {
  141.         $this->bedForCamper $bedForCamper;
  142.         return $this;
  143.     }
  144.     public function isBedClosedFlag(): bool
  145.     {
  146.         return $this->bedClosedFlag;
  147.     }
  148.     public function setBedClosedFlag(bool $bedClosedFlag): Occupancy
  149.     {
  150.         $this->bedClosedFlag $bedClosedFlag;
  151.         return $this;
  152.     }
  153.     public function isBedOpenFlag(): ?bool
  154.     {
  155.         if($this->isBedClosedFlag())
  156.             return false;
  157.         else
  158.             return true;
  159.     }
  160.     public function getBedOpen(): ?bool {
  161.         return $this->isBedOpen();
  162.     }
  163.     /**
  164.      * @param mixed $bedName
  165.      *
  166.      * @return Occupancy
  167.      */
  168.     public function setBedName($bedName)
  169.     {
  170.         $this->bedName $bedName;
  171.         return $this;
  172.     }
  173.     /**
  174.      * @return mixed
  175.      */
  176.     public function getBedRate()
  177.     {
  178.         return $this->bedRate;
  179.     }
  180.     /**
  181.      * @param mixed $bedRate
  182.      *
  183.      * @return Occupancy
  184.      */
  185.     public function setBedRate($bedRate)
  186.     {
  187.         $this->bedRate $bedRate;
  188.         return $this;
  189.     }
  190.     /**
  191.      * @return mixed
  192.      */
  193.     public function getBedOccupancyStatus()
  194.     {
  195.         return $this->bedOccupancyStatus;
  196.     }
  197.     /**
  198.      * @param mixed $bedOccupancyStatus
  199.      *
  200.      * @return Occupancy
  201.      */
  202.     public function setBedOccupancyStatus($bedOccupancyStatus)
  203.     {
  204.         $this->bedOccupancyStatus $bedOccupancyStatus;
  205.         return $this;
  206.     }
  207.     /**
  208.      * @return mixed
  209.      */
  210.     public function getBedOccupant()
  211.     {
  212.         return $this->bedOccupant;
  213.     }
  214.     /**
  215.      * @param mixed $bedOccupant
  216.      *
  217.      * @return Occupancy
  218.      */
  219.     public function setBedOccupant($bedOccupant)
  220.     {
  221.         $this->bedOccupant $bedOccupant;
  222.         return $this;
  223.     }
  224.     /**
  225.      * @return mixed
  226.      */
  227.     public function getBookingId()
  228.     {
  229.         return $this->bookingId;
  230.     }
  231.     /**
  232.      * @param mixed $bookingId
  233.      *
  234.      * @return Occupancy
  235.      */
  236.     public function setBookingId($bookingId)
  237.     {
  238.         $this->bookingId $bookingId;
  239.         return $this;
  240.     }
  241.     /**
  242.      * @return mixed
  243.      */
  244.     public function getBookingStudent()
  245.     {
  246.         return $this->bookingStudent;
  247.     }
  248.     /**
  249.      * @param mixed $bookingStudent
  250.      *
  251.      * @return Occupancy
  252.      */
  253.     public function setBookingStudent($bookingStudent)
  254.     {
  255.         $this->bookingStudent $bookingStudent;
  256.         return $this;
  257.     }
  258.     /**
  259.      * @return null
  260.      */
  261.     public function getBookingRateCharged()
  262.     {
  263.         return $this->bookingRateCharged;
  264.     }
  265.     /**
  266.      * @param null $bookingRateCharged
  267.      *
  268.      * @return Occupancy
  269.      */
  270.     public function setBookingRateCharged($bookingRateCharged)
  271.     {
  272.         $this->bookingRateCharged $bookingRateCharged;
  273.         return $this;
  274.     }
  275.     /**
  276.      * @return \DateTimeInterface|null
  277.      */
  278.     public function getBookingReservationStartDate(): ?\DateTimeInterface
  279.     {
  280.         return $this->bookingReservationStartDate;
  281.     }
  282.     /**
  283.      * @param \DateTimeInterface|null $bookingReservationStartDate
  284.      *
  285.      * @return Occupancy
  286.      */
  287.     public function setBookingReservationStartDate(?\DateTimeInterface $bookingReservationStartDate): Occupancy
  288.     {
  289.         $this->bookingReservationStartDate $bookingReservationStartDate;
  290.         return $this;
  291.     }
  292.     /**
  293.      * @return \DateTimeInterface|null
  294.      */
  295.     public function getBookingReservationEndDate(): ?\DateTimeInterface
  296.     {
  297.         return $this->bookingReservationEndDate;
  298.     }
  299.     /**
  300.      * @param \DateTimeInterface|null $bookingReservationEndDate
  301.      *
  302.      * @return Occupancy
  303.      */
  304.     public function setBookingReservationEndDate(?\DateTimeInterface $bookingReservationEndDate): Occupancy
  305.     {
  306.         $this->bookingReservationEndDate $bookingReservationEndDate;
  307.         return $this;
  308.     }
  309.     /**
  310.      * @return \DateTimeInterface|null
  311.      */
  312.     public function getBookingCheckInDate(): ?\DateTimeInterface
  313.     {
  314.         return $this->bookingCheckInDate;
  315.     }
  316.     /**
  317.      * @param \DateTimeInterface|null $bookingCheckInDate
  318.      *
  319.      * @return Occupancy
  320.      */
  321.     public function setBookingCheckInDate(?\DateTimeInterface $bookingCheckInDate): Occupancy
  322.     {
  323.         $this->bookingCheckInDate $bookingCheckInDate;
  324.         return $this;
  325.     }
  326.     /**
  327.      * @return \DateTimeInterface|null
  328.      */
  329.     public function getBookingCheckOutDate(): ?\DateTimeInterface
  330.     {
  331.         return $this->bookingCheckOutDate;
  332.     }
  333.     /**
  334.      * @param \DateTimeInterface|null $bookingCheckOutDate
  335.      *
  336.      * @return Occupancy
  337.      */
  338.     public function setBookingCheckOutDate(?\DateTimeInterface $bookingCheckOutDate): Occupancy
  339.     {
  340.         $this->bookingCheckOutDate $bookingCheckOutDate;
  341.         return $this;
  342.     }
  343.     public function isCheckedIn() : bool
  344.     {
  345.         if ($this->bookingCheckInDate) {
  346.             return true;
  347.         }
  348.         return false;
  349.     }
  350.     public function isCheckedOut() : bool
  351.     {
  352.         if ($this->bookingCheckOutDate) {
  353.             return true;
  354.         }
  355.         return false;
  356.     }
  357.     public function isPreviousCheckedIn() : bool
  358.     {
  359.         if ($this->previousBookingCheckInDate) {
  360.             return true;
  361.         }
  362.         return false;
  363.     }
  364.     public function isPreviousCheckedOut() : bool
  365.     {
  366.         if ($this->previousBookingCheckOutDate) {
  367.             return true;
  368.         }
  369.         return false;
  370.     }
  371.     public function isNextCheckedIn() : bool
  372.     {
  373.         if ($this->nextBookingCheckInDate) {
  374.             return true;
  375.         }
  376.         return false;
  377.     }
  378.     public function isNextCheckedOut() : bool
  379.     {
  380.         if ($this->nextBookingCheckOutDate) {
  381.             return true;
  382.         }
  383.         return false;
  384.     }
  385.     public function isTempCheckedOut() : bool
  386.     {
  387.         if ($this->bookingTemporaryCheckOutDate) {
  388.             return true;
  389.         }
  390.         return false;
  391.     }
  392.     /**
  393.      * @return \DateTimeInterface|null
  394.      */
  395.     public function getBookingExpectedCheckInDate(): ?\DateTimeInterface
  396.     {
  397.         return $this->bookingExpectedCheckInDate;
  398.     }
  399.     /**
  400.      * @param \DateTimeInterface|null $bookingExpectedCheckInDate
  401.      *
  402.      * @return Occupancy
  403.      */
  404.     public function setBookingExpectedCheckInDate(?\DateTimeInterface $bookingExpectedCheckInDate): Occupancy
  405.     {
  406.         $this->bookingExpectedCheckInDate $bookingExpectedCheckInDate;
  407.         return $this;
  408.     }
  409.     /**
  410.      * @return \DateTimeInterface|null
  411.      */
  412.     public function getBookingExpectedCheckOutDate(): ?\DateTimeInterface
  413.     {
  414.         return $this->bookingExpectedCheckOutDate;
  415.     }
  416.     /**
  417.      * @param \DateTimeInterface|null $bookingExpectedCheckOutDate
  418.      *
  419.      * @return Occupancy
  420.      */
  421.     public function setBookingExpectedCheckOutDate(?\DateTimeInterface $bookingExpectedCheckOutDate): Occupancy
  422.     {
  423.         $this->bookingExpectedCheckOutDate $bookingExpectedCheckOutDate;
  424.         return $this;
  425.     }
  426.     /**
  427.      * @return \DateTimeInterface|null
  428.      */
  429.     public function getBookingTemporaryCheckOutDate(): ?\DateTimeInterface
  430.     {
  431.         return $this->bookingTemporaryCheckOutDate;
  432.     }
  433.     /**
  434.      * @param \DateTimeInterface|null $bookingTemporaryCheckOutDate
  435.      *
  436.      * @return Occupancy
  437.      */
  438.     public function setBookingTemporaryCheckOutDate(?\DateTimeInterface $bookingTemporaryCheckOutDate): Occupancy
  439.     {
  440.         $this->bookingTemporaryCheckOutDate $bookingTemporaryCheckOutDate;
  441.         return $this;
  442.     }
  443.     /**
  444.      * @return \DateTimeInterface|null
  445.      */
  446.     public function getBookingBillingStartDate(): ?\DateTimeInterface
  447.     {
  448.         return $this->bookingBillingStartDate;
  449.     }
  450.     /**
  451.      * @param \DateTimeInterface|null $bookingBillingStartDate
  452.      *
  453.      * @return Occupancy
  454.      */
  455.     public function setBookingBillingStartDate(?\DateTimeInterface $bookingBillingStartDate): Occupancy
  456.     {
  457.         $this->bookingBillingStartDate $bookingBillingStartDate;
  458.         return $this;
  459.     }
  460.     /**
  461.      * @return \DateTimeInterface|null
  462.      */
  463.     public function getBookingBillingEndDate(): ?\DateTimeInterface
  464.     {
  465.         return $this->bookingBillingEndDate;
  466.     }
  467.     /**
  468.      * @param \DateTimeInterface|null $bookingBillingEndDate
  469.      *
  470.      * @return Occupancy
  471.      */
  472.     public function setBookingBillingEndDate(?\DateTimeInterface $bookingBillingEndDate): Occupancy
  473.     {
  474.         $this->bookingBillingEndDate $bookingBillingEndDate;
  475.         return $this;
  476.     }
  477.     /**
  478.      * @return bool|null
  479.      */
  480.     public function getBookingFlagBillingReview(): ?bool
  481.     {
  482.         return $this->bookingFlagBillingReview;
  483.     }
  484.     /**
  485.      * @param bool|null $bookingFlagBillingReview
  486.      *
  487.      * @return Occupancy
  488.      */
  489.     public function setBookingFlagBillingReview(?bool $bookingFlagBillingReview): Occupancy
  490.     {
  491.         $this->bookingFlagBillingReview $bookingFlagBillingReview;
  492.         return $this;
  493.     }
  494.     /**
  495.      * @return string|null
  496.      */
  497.     public function getBookingInvoiceNumber(): ?string
  498.     {
  499.         return $this->bookingInvoiceNumber;
  500.     }
  501.     /**
  502.      * @param string|null $bookingInvoiceNumber
  503.      *
  504.      * @return Occupancy
  505.      */
  506.     public function setBookingInvoiceNumber(?string $bookingInvoiceNumber): Occupancy
  507.     {
  508.         $this->bookingInvoiceNumber $bookingInvoiceNumber;
  509.         return $this;
  510.     }
  511.     /**
  512.      * @return string
  513.      */
  514.     public function getBookingStatus(): string
  515.     {
  516.         return $this->bookingStatus;
  517.     }
  518.     /**
  519.      * @param string $bookingStatus
  520.      *
  521.      * @return Occupancy
  522.      */
  523.     public function setBookingStatus(?string $bookingStatus): Occupancy
  524.     {
  525.         if(is_null($bookingStatus)) $bookingStatus='new';
  526.         $this->bookingStatus $bookingStatus;
  527.         return $this;
  528.     }
  529.     /**
  530.      * @return int
  531.      */
  532.     public function getBookingStatusText(): int
  533.     {
  534.         return $this->bookingStatusText;
  535.     }
  536.     /**
  537.      * @param int $bookingStatusText
  538.      *
  539.      * @return Occupancy
  540.      */
  541.     public function setBookingStatusText(int $bookingStatusText): Occupancy
  542.     {
  543.         $this->bookingStatusText $bookingStatusText;
  544.         return $this;
  545.     }
  546.     /**
  547.      * @return null
  548.      */
  549.     public function getBuildingId()
  550.     {
  551.         return $this->buildingId;
  552.     }
  553.     /**
  554.      * @param null $buildingId
  555.      *
  556.      * @return Occupancy
  557.      */
  558.     public function setBuildingId($buildingId)
  559.     {
  560.         $this->buildingId $buildingId;
  561.         return $this;
  562.     }
  563.     /**
  564.      * @return null
  565.      */
  566.     public function getBuildingName()
  567.     {
  568.         return $this->buildingName;
  569.     }
  570.     /**
  571.      * @param null $buildingName
  572.      *
  573.      * @return Occupancy
  574.      */
  575.     public function setBuildingName($buildingName)
  576.     {
  577.         $this->buildingName $buildingName;
  578.         return $this;
  579.     }
  580.     /**
  581.      * @return null
  582.      */
  583.     public function getBuildingCode()
  584.     {
  585.         return $this->buildingCode;
  586.     }
  587.     /**
  588.      * @param null $buildingCode
  589.      *
  590.      * @return Occupancy
  591.      */
  592.     public function setBuildingCode($buildingCode)
  593.     {
  594.         $this->buildingCode $buildingCode;
  595.         return $this;
  596.     }
  597.     /**
  598.      * @return null
  599.      */
  600.     public function getRoomId()
  601.     {
  602.         return $this->roomId;
  603.     }
  604.     /**
  605.      * @param null $roomId
  606.      *
  607.      * @return Occupancy
  608.      */
  609.     public function setRoomId($roomId)
  610.     {
  611.         $this->roomId $roomId;
  612.         return $this;
  613.     }
  614.     /**
  615.      * @return null
  616.      */
  617.     public function getRoomName()
  618.     {
  619.         return $this->roomName;
  620.     }
  621.     /**
  622.      * @param null $roomName
  623.      *
  624.      * @return Occupancy
  625.      */
  626.     public function setRoomName($roomName)
  627.     {
  628.         $this->roomName $roomName;
  629.         return $this;
  630.     }
  631.     /**
  632.      * @return null
  633.      */
  634.     public function getFloorId()
  635.     {
  636.         return $this->floorId;
  637.     }
  638.     /**
  639.      * @param null $floorId
  640.      *
  641.      * @return Occupancy
  642.      */
  643.     public function setFloorId($floorId)
  644.     {
  645.         $this->floorId $floorId;
  646.         return $this;
  647.     }
  648.     /**
  649.      * @return null
  650.      */
  651.     public function getFloorName()
  652.     {
  653.         return $this->floorName;
  654.     }
  655.     /**
  656.      * @param null $floorName
  657.      *
  658.      * @return Occupancy
  659.      */
  660.     public function setFloorName($floorName)
  661.     {
  662.         $this->floorName $floorName;
  663.         return $this;
  664.     }
  665.     /**
  666.      * @return null
  667.      */
  668.     public function getWingmId()
  669.     {
  670.         return $this->wingmId;
  671.     }
  672.     /**
  673.      * @param null $wingmId
  674.      *
  675.      * @return Occupancy
  676.      */
  677.     public function setWingmId($wingmId)
  678.     {
  679.         $this->wingmId $wingmId;
  680.         return $this;
  681.     }
  682.     /**
  683.      * @return null
  684.      */
  685.     public function getWingName()
  686.     {
  687.         return $this->wingName;
  688.     }
  689.     /**
  690.      * @param null $wingName
  691.      *
  692.      * @return Occupancy
  693.      */
  694.     public function setWingName($wingName)
  695.     {
  696.         $this->wingName $wingName;
  697.         return $this;
  698.     }
  699.     /**
  700.      * @return null
  701.      */
  702.     public function getPreviousBookingId()
  703.     {
  704.         return $this->previousBookingId;
  705.     }
  706.     /**
  707.      * @param null $previousBookingId
  708.      * @return Occupancy
  709.      */
  710.     public function setPreviousBookingId($previousBookingId)
  711.     {
  712.         $this->previousBookingId $previousBookingId;
  713.         return $this;
  714.     }
  715.     public function getPreviousBookingUuid(): ?Ulid
  716.     {
  717.         return $this->previousBookingUuid;
  718.     }
  719.     public function setPreviousBookingUuid(?Ulid $previousBookingUuid): Occupancy
  720.     {
  721.         $this->previousBookingUuid $previousBookingUuid;
  722.         return $this;
  723.     }
  724.     /**
  725.      * @return null
  726.      */
  727.     public function getPreviousBookingBedName()
  728.     {
  729.         return $this->previousBookingBedName;
  730.     }
  731.     /**
  732.      * @param null $previousBookingBedName
  733.      * @return Occupancy
  734.      */
  735.     public function setPreviousBookingBedName($previousBookingBedName)
  736.     {
  737.         $this->previousBookingBedName $previousBookingBedName;
  738.         return $this;
  739.     }
  740.     public function getPreviousBookingCheckInDate(): ?\DateTimeInterface
  741.     {
  742.         return $this->previousBookingCheckInDate;
  743.     }
  744.     public function setPreviousBookingCheckInDate(?\DateTimeInterface $previousBookingCheckInDate): Occupancy
  745.     {
  746.         $this->previousBookingCheckInDate $previousBookingCheckInDate;
  747.         return $this;
  748.     }
  749.     public function getPreviousBookingCheckOutDate(): ?\DateTimeInterface
  750.     {
  751.         return $this->previousBookingCheckOutDate;
  752.     }
  753.     public function setPreviousBookingCheckOutDate(?\DateTimeInterface $previousBookingCheckOutDate): Occupancy
  754.     {
  755.         $this->previousBookingCheckOutDate $previousBookingCheckOutDate;
  756.         return $this;
  757.     }
  758.     /**
  759.      * @return null
  760.      */
  761.     public function getNextBookingId()
  762.     {
  763.         return $this->nextBookingId;
  764.     }
  765.     /**
  766.      * @param null $nextBookingId
  767.      * @return Occupancy
  768.      */
  769.     public function setNextBookingId($nextBookingId)
  770.     {
  771.         $this->nextBookingId $nextBookingId;
  772.         return $this;
  773.     }
  774.     public function getNextBookingUuid(): ?Ulid
  775.     {
  776.         return $this->nextBookingUuid;
  777.     }
  778.     public function setNextBookingUuid(?Ulid $nextBookingUuid): Occupancy
  779.     {
  780.         $this->nextBookingUuid $nextBookingUuid;
  781.         return $this;
  782.     }
  783.     /**
  784.      * @return null
  785.      */
  786.     public function getNextBookingBedName()
  787.     {
  788.         return $this->nextBookingBedName;
  789.     }
  790.     /**
  791.      * @param null $nextBookingBedName
  792.      * @return Occupancy
  793.      */
  794.     public function setNextBookingBedName($nextBookingBedName)
  795.     {
  796.         $this->nextBookingBedName $nextBookingBedName;
  797.         return $this;
  798.     }
  799.     public function getNextBookingCheckInDate(): ?\DateTimeInterface
  800.     {
  801.         return $this->nextBookingCheckInDate;
  802.     }
  803.     public function setNextBookingCheckInDate(?\DateTimeInterface $nextBookingCheckInDate): Occupancy
  804.     {
  805.         $this->nextBookingCheckInDate $nextBookingCheckInDate;
  806.         return $this;
  807.     }
  808.     public function getNextBookingCheckOutDate(): ?\DateTimeInterface
  809.     {
  810.         return $this->nextBookingCheckOutDate;
  811.     }
  812.     public function setNextBookingCheckOutDate(?\DateTimeInterface $nextBookingCheckOutDate): Occupancy
  813.     {
  814.         $this->nextBookingCheckOutDate $nextBookingCheckOutDate;
  815.         return $this;
  816.     }
  817.     /*************************************/
  818.     /*******  Assets               *******/
  819.     /*************************************/
  820.     /**
  821.      * @return mixed
  822.      */
  823.     public function getBedMailbox()
  824.     {
  825.         return $this->bedMailbox;
  826.     }
  827.     /**
  828.      * @param mixed $bedMailbox
  829.      * @return Occupancy
  830.      */
  831.     public function setBedMailbox($bedMailbox)
  832.     {
  833.         $this->bedMailbox $bedMailbox;
  834.         return $this;
  835.     }
  836.     /**
  837.      * @return mixed
  838.      */
  839.     public function getRoomAccessKey()
  840.     {
  841.         return $this->roomAccessKey;
  842.     }
  843.     /**
  844.      * @param mixed $roomAccessKey
  845.      * @return Occupancy
  846.      */
  847.     public function setRoomAccessKey($roomAccessKey)
  848.     {
  849.         $this->roomAccessKey $roomAccessKey;
  850.         return $this;
  851.     }
  852.     /**
  853.      * @return mixed
  854.      */
  855.     public function getBuildingAccessKey()
  856.     {
  857.         return $this->buildingAccessKey;
  858.     }
  859.     /**
  860.      * @param mixed $buildingAccessKey
  861.      * @return Occupancy
  862.      */
  863.     public function setBuildingAccessKey($buildingAccessKey)
  864.     {
  865.         $this->buildingAccessKey $buildingAccessKey;
  866.         return $this;
  867.     }
  868.     /**
  869.      * @return mixed
  870.      */
  871.     public function getRoomPhoneExtension()
  872.     {
  873.         return $this->roomPhoneExtension;
  874.     }
  875.     /**
  876.      * @param mixed $roomPhoneExtension
  877.      * @return Occupancy
  878.      */
  879.     public function setRoomPhoneExtension($roomPhoneExtension)
  880.     {
  881.         $this->roomPhoneExtension $roomPhoneExtension;
  882.         return $this;
  883.     }
  884.     /*************************************/
  885.     /*******  ULIDs               *******/
  886.     /*************************************/
  887.     /**
  888.      * @return Ulid|null
  889.      */
  890.     public function getBedUuid(): ?Ulid
  891.     {
  892.         return $this->bedUuid;
  893.     }
  894.     /**
  895.      * @param Ulid|null $bedUuid
  896.      *
  897.      * @return Occupancy
  898.      */
  899.     public function setBedUuid(?Ulid $bedUuid): Occupancy
  900.     {
  901.         $this->bedUuid $bedUuid;
  902.         return $this;
  903.     }
  904.     /**
  905.      * @return Ulid|null
  906.      */
  907.     public function getBookingUuid(): ?Ulid
  908.     {
  909.         return $this->bookingUuid;
  910.     }
  911.     /**
  912.      * @param Ulid|null $bookingUuid
  913.      *
  914.      * @return Occupancy
  915.      */
  916.     public function setBookingUuid(?Ulid $bookingUuid): Occupancy
  917.     {
  918.         $this->bookingUuid $bookingUuid;
  919.         return $this;
  920.     }
  921.     /**
  922.      * @return Ulid|null
  923.      */
  924.     public function getBuildingUuid(): ?Ulid
  925.     {
  926.         return $this->buildingUuid;
  927.     }
  928.     /**
  929.      * @param Ulid|null $buildingUuid
  930.      *
  931.      * @return Occupancy
  932.      */
  933.     public function setBuildingUuid(?Ulid $buildingUuid): Occupancy
  934.     {
  935.         $this->buildingUuid $buildingUuid;
  936.         return $this;
  937.     }
  938.     /**
  939.      * @return Ulid|null
  940.      */
  941.     public function getFloorUuid(): ?Ulid
  942.     {
  943.         return $this->floorUuid;
  944.     }
  945.     /**
  946.      * @param Ulid|null $floorUuid
  947.      *
  948.      * @return Occupancy
  949.      */
  950.     public function setFloorUuid(?Ulid $floorUuid): Occupancy
  951.     {
  952.         $this->floorUuid $floorUuid;
  953.         return $this;
  954.     }
  955.     /**
  956.      * @return Ulid|null
  957.      */
  958.     public function getWingUuid(): ?Ulid
  959.     {
  960.         return $this->wingUuid;
  961.     }
  962.     /**
  963.      * @param Ulid|null $wingUuid
  964.      *
  965.      * @return Occupancy
  966.      */
  967.     public function setWingUuid(?Ulid $wingUuid): Occupancy
  968.     {
  969.         $this->wingUuid $wingUuid;
  970.         return $this;
  971.     }
  972.     /**
  973.      * @return Ulid|null
  974.      */
  975.     public function getRoomUuid(): ?Ulid
  976.     {
  977.         return $this->roomUuid;
  978.     }
  979.     /**
  980.      * @param Ulid|null $roomUuid
  981.      *
  982.      * @return Occupancy
  983.      */
  984.     public function setRoomUuid(?Ulid $roomUuid): Occupancy
  985.     {
  986.         $this->roomUuid $roomUuid;
  987.         return $this;
  988.     }
  989.     /**********************************/
  990.     /**
  991.      * @return null
  992.      */
  993.     public function getOccupantId()
  994.     {
  995.         return $this->occupantId;
  996.     }
  997.     /**
  998.      * @param null $occupantId
  999.      *
  1000.      * @return Occupancy
  1001.      */
  1002.     public function setOccupantId($occupantId)
  1003.     {
  1004.         $this->occupantId $occupantId;
  1005.         return $this;
  1006.     }
  1007.     /**
  1008.      * @return Ulid|null
  1009.      */
  1010.     public function getOccupantUuid(): ?Ulid
  1011.     {
  1012.         return $this->occupantUuid;
  1013.     }
  1014.     /**
  1015.      * @param Ulid|null $occupantUuid
  1016.      *
  1017.      * @return Occupancy
  1018.      */
  1019.     public function setOccupantUuid(?Ulid $occupantUuid): Occupancy
  1020.     {
  1021.         $this->occupantUuid $occupantUuid;
  1022.         return $this;
  1023.     }
  1024.     /**
  1025.      * @return null
  1026.      */
  1027.     public function getOccupantNumber()
  1028.     {
  1029.         return $this->occupantNumber;
  1030.     }
  1031.     /**
  1032.      * @param null $occupantNumber
  1033.      *
  1034.      * @return Occupancy
  1035.      */
  1036.     public function setOccupantNumber($occupantNumber)
  1037.     {
  1038.         $this->occupantNumber $occupantNumber;
  1039.         return $this;
  1040.     }
  1041.     /**
  1042.      * @return null
  1043.      */
  1044.     public function getOccupantGivenName()
  1045.     {
  1046.         return $this->occupantGivenName;
  1047.     }
  1048.     /**
  1049.      * @param null $occupantGivenName
  1050.      *
  1051.      * @return Occupancy
  1052.      */
  1053.     public function setOccupantGivenName($occupantGivenName)
  1054.     {
  1055.         $this->occupantGivenName $occupantGivenName;
  1056.         return $this;
  1057.     }
  1058.     /**
  1059.      * @return null
  1060.      */
  1061.     public function getOccupantLastName()
  1062.     {
  1063.         return $this->occupantLastName;
  1064.     }
  1065.     /**
  1066.      * @param null $occupantLastName
  1067.      *
  1068.      * @return Occupancy
  1069.      */
  1070.     public function setOccupantLastName($occupantLastName)
  1071.     {
  1072.         $this->occupantLastName $occupantLastName;
  1073.         return $this;
  1074.     }
  1075.     /**
  1076.      * @return null
  1077.      */
  1078.     public function getOccupantEmail()
  1079.     {
  1080.         return $this->occupantEmail;
  1081.     }
  1082.     /**
  1083.      * @param null $occupantEmail
  1084.      *
  1085.      * @return Occupancy
  1086.      */
  1087.     public function setOccupantEmail($occupantEmail)
  1088.     {
  1089.         $this->occupantEmail $occupantEmail;
  1090.         return $this;
  1091.     }
  1092.     /**
  1093.      * @return null
  1094.      */
  1095.     public function getOccupantPhone()
  1096.     {
  1097.         return $this->occupantPhone;
  1098.     }
  1099.     /**
  1100.      * @param null $occupantPhone
  1101.      *
  1102.      * @return Occupancy
  1103.      */
  1104.     public function setOccupantPhone($occupantPhone)
  1105.     {
  1106.         $this->occupantPhone $occupantPhone;
  1107.         return $this;
  1108.     }
  1109.     /**
  1110.      * @return null
  1111.      */
  1112.     public function getOccupantGender()
  1113.     {
  1114.         return $this->occupantGender;
  1115.     }
  1116.     /**
  1117.      * @param null $occupantGender
  1118.      *
  1119.      * @return Occupancy
  1120.      */
  1121.     public function setOccupantGender($occupantGender)
  1122.     {
  1123.         $this->occupantGender $occupantGender;
  1124.         return $this;
  1125.     }
  1126.     /**
  1127.      * @return null
  1128.      */
  1129.     public function getOccupantType()
  1130.     {
  1131.         return $this->occupantType;
  1132.     }
  1133.     /**
  1134.      * @param null $occupantType
  1135.      *
  1136.      * @return Occupancy
  1137.      */
  1138.     public function setOccupantType($occupantType)
  1139.     {
  1140.         $this->occupantType $occupantType;
  1141.         return $this;
  1142.     }
  1143.     /**
  1144.      * @return null
  1145.      */
  1146.     public function getOccupantGroup()
  1147.     {
  1148.         return $this->occupantGroup;
  1149.     }
  1150.     /**
  1151.      * @param null $occupantGroup
  1152.      *
  1153.      * @return Occupancy
  1154.      */
  1155.     public function setOccupantGroup($occupantGroup)
  1156.     {
  1157.         $this->occupantGroup $occupantGroup;
  1158.         return $this;
  1159.     }
  1160.     /**
  1161.      * @return null
  1162.      */
  1163.     public function getOccupantCountry()
  1164.     {
  1165.         return $this->occupantCountry;
  1166.     }
  1167.     /**
  1168.      * @param null $occupantCountry
  1169.      *
  1170.      * @return Occupancy
  1171.      */
  1172.     public function setOccupantCountry($occupantCountry)
  1173.     {
  1174.         $this->occupantCountry $occupantCountry;
  1175.         return $this;
  1176.     }
  1177.     /**
  1178.      * @return null
  1179.      */
  1180.     public function getOccupantBirthCountry()
  1181.     {
  1182.         return $this->occupantBirthCountry;
  1183.     }
  1184.     /**
  1185.      * @param null $occupantBirthCountry
  1186.      */
  1187.     public function setOccupantBirthCountry($occupantBirthCountry): void
  1188.     {
  1189.         $this->occupantBirthCountry $occupantBirthCountry;
  1190.     }
  1191.     /**
  1192.      * @return \DateTimeInterface|null
  1193.      */
  1194.     public function getOccupantDateOfBirth(): ?\DateTimeInterface
  1195.     {
  1196.         return $this->occupantDateOfBirth;
  1197.     }
  1198.     /**
  1199.      * @param \DateTimeInterface|null $occupantDateOfBirth
  1200.      *
  1201.      * @return Occupancy
  1202.      */
  1203.     public function setOccupantDateOfBirth(?\DateTimeInterface $occupantDateOfBirth): Occupancy
  1204.     {
  1205.         $this->occupantDateOfBirth $occupantDateOfBirth;
  1206.         return $this;
  1207.     }
  1208.     public function getOccupantAge() : ?int
  1209.     {
  1210.         if (empty($this->getOccupantDateOfBirth())) {
  1211.             return null;
  1212.         }
  1213.         $age $this->getOccupantDateOfBirth()->diff(new \DateTime())->y;
  1214.         return $age;
  1215.     }
  1216.     /*************************************/
  1217.     function camel_to_snake($input)
  1218.     {
  1219.         return strtolower(preg_replace('/(?<!^)[A-Z]/''_$0'$input));
  1220.     }
  1221.     function snakeToCamel($input)
  1222.     {
  1223.         return lcfirst(str_replace(' '''ucwords(str_replace('_'' '$input))));
  1224. //        return lcfirst(str_replace('', '', ucwords($input, '')));
  1225.     }
  1226.     public function serialize()
  1227.     {
  1228.         return $this->__serialize();
  1229.     }
  1230.     public function __serialize() {
  1231. //        return $this->toArray();
  1232.         return $this->toArray();
  1233.     }
  1234.     public function jsonSerialize()
  1235.     {
  1236.         return $this->__serialize();
  1237.     }
  1238.     public function toArray()
  1239.     {
  1240.         $data = [];
  1241.         foreach (get_object_vars($this) as $key => $val) {
  1242.             $f 'get' ucfirst($key);
  1243.             switch ($key) {
  1244.                 case "bookingReservationStartDate":
  1245.                 case "bookingReservationEndDate":
  1246.                 case "bookingCheckInDate":
  1247.                 case "bookingCheckOutDate":
  1248.                 case "bookingExpectedCheckInDate":
  1249.                 case "bookingExpectedCheckOutDate":
  1250.                 case "bookingTemporaryCheckOutDate":
  1251.                 case "bookingBillingStartDate":
  1252.                 case "bookingBillingEndDate":
  1253.                 case "studentDateOfBirth":
  1254.                 case "occupantDateOfBirth":
  1255.                 case "startDate":
  1256.                 case "endDate":
  1257.                 case "previousBookingCheckInDate":
  1258.                 case "previousBookingCheckOutDate":
  1259.                 case "nextBookingCheckInDate":
  1260.                 case "nextBookingCheckOutDate":
  1261.                     /* @var $val \DateTime */
  1262.                     $data[$this->camel_to_snake($key)] = $val->format("c");
  1263.                     break;
  1264.                 default:
  1265.                     /* @var $val string */
  1266.                     $data[$this->camel_to_snake($key)] = $this->$f();
  1267.                     break;
  1268.             }
  1269.         }
  1270. //        dd($data);
  1271.         return $data;
  1272.     }
  1273.     /**
  1274.      * @return mixed
  1275.      */
  1276.     public function getBedStatus()
  1277.     {
  1278.         return $this->bedStatus;
  1279.     }
  1280.     /**
  1281.      * @param mixed $bedStatus
  1282.      */
  1283.     public function setBedStatus($bedStatus): void
  1284.     {
  1285.         $this->bedStatus $bedStatus;
  1286.     }
  1287.     /**
  1288.      * @return mixed
  1289.      */
  1290.     public function getRoomStatus()
  1291.     {
  1292.         return $this->roomStatus;
  1293.     }
  1294.     /**
  1295.      * @param mixed $roomStatus
  1296.      */
  1297.     public function setRoomStatus($roomStatus): void
  1298.     {
  1299.         $this->roomStatus $roomStatus;
  1300.     }
  1301.     /**
  1302.      * @return mixed
  1303.      */
  1304.     public function getRoomType()
  1305.     {
  1306.         return $this->roomType;
  1307.     }
  1308.     /**
  1309.      * @param mixed $roomType
  1310.      * @return Occupancy
  1311.      */
  1312.     public function setRoomType($roomType)
  1313.     {
  1314.         $this->roomType $roomType;
  1315.         return $this;
  1316.     }
  1317.     /**
  1318.      * @return mixed
  1319.      */
  1320.     public function getRoomBathType()
  1321.     {
  1322.         return $this->roomBathType;
  1323.     }
  1324.     /**
  1325.      * @param mixed $roomBathType
  1326.      * @return Occupancy
  1327.      */
  1328.     public function setRoomBathType($roomBathType)
  1329.     {
  1330.         $this->roomBathType $roomBathType;
  1331.         return $this;
  1332.     }
  1333.     public function isOccupantYouthFlag(): bool
  1334.     {
  1335.         return $this->occupantYouthFlag;
  1336.     }
  1337.     public function setOccupantYouthFlag(bool $occupantYouthFlag): Occupancy
  1338.     {
  1339.         $this->occupantYouthFlag $occupantYouthFlag;
  1340.         return $this;
  1341.     }
  1342.     /**
  1343.      * @return mixed
  1344.      */
  1345.     public function getOccupantProgram()
  1346.     {
  1347.         return $this->occupantProgram;
  1348.     }
  1349.     /**
  1350.      * @param mixed $occupantProgram
  1351.      * @return Occupancy
  1352.      */
  1353.     public function setOccupantProgram($occupantProgram)
  1354.     {
  1355.         $this->occupantProgram $occupantProgram;
  1356.         return $this;
  1357.     }
  1358.     public function isPotentialGraduateFlag(): bool
  1359.     {
  1360.         return $this->potentialGraduateFlag;
  1361.     }
  1362.     public function setPotentialGraduateFlag(bool $potentialGraduateFlag): Occupancy
  1363.     {
  1364.         $this->potentialGraduateFlag $potentialGraduateFlag;
  1365.         return $this;
  1366.     }
  1367.     public function getPotentialGraduateSem(): string
  1368.     {
  1369.         return $this->potentialGraduateSem;
  1370.     }
  1371.     public function setPotentialGraduateSem(string $potentialGraduateSem): Occupancy
  1372.     {
  1373.         $this->potentialGraduateSem $potentialGraduateSem;
  1374.         return $this;
  1375.     }
  1376.     public function isGraduatedFlag(): bool
  1377.     {
  1378.         return $this->graduatedFlag;
  1379.     }
  1380.     public function setGraduatedFlag(bool $graduatedFlag): Occupancy
  1381.     {
  1382.         $this->graduatedFlag $graduatedFlag;
  1383.         return $this;
  1384.     }
  1385.     public function getExtra(): array
  1386.     {
  1387.         return $this->extra;
  1388.     }
  1389.     public function setExtra(array $extra): Occupancy
  1390.     {
  1391.         $this->extra $extra;
  1392.         return $this;
  1393.     }
  1394.     public function getStudentId(): ?int
  1395.     {
  1396.         return $this->studentId;
  1397.     }
  1398.     public function setStudentId(?int $studentId): Occupancy
  1399.     {
  1400.         $this->studentId $studentId;
  1401.         return $this;
  1402.     }
  1403.     public function getStudentUuid(): ?Ulid
  1404.     {
  1405.         return $this->studentUuid;
  1406.     }
  1407.     public function setStudentUuid(?Ulid $studentUuid): Occupancy
  1408.     {
  1409.         $this->studentUuid $studentUuid;
  1410.         return $this;
  1411.     }
  1412.     public function getCamperId(): ?int
  1413.     {
  1414.         return $this->camperId;
  1415.     }
  1416.     public function setCamperId(?int $camperId): Occupancy
  1417.     {
  1418.         $this->camperId $camperId;
  1419.         return $this;
  1420.     }
  1421.     public function getCamperUuid(): ?Ulid
  1422.     {
  1423.         return $this->camperUuid;
  1424.     }
  1425.     public function setCamperUuid(?Ulid $camperUuid): Occupancy
  1426.     {
  1427.         $this->camperUuid $camperUuid;
  1428.         return $this;
  1429.     }
  1430.     public function getOverStayFlag(): ?string
  1431.     {
  1432.         return $this->overStayFlag;
  1433.     }
  1434.     public function setOverStayFlag(?string $overStayFlag): Occupancy
  1435.     {
  1436.         $this->overStayFlag $overStayFlag;
  1437.         return $this;
  1438.     }
  1439.     public function unserialize($serialized)
  1440.     {
  1441.         $this->__unserialize($serialized);
  1442.     }
  1443.     function __unserialize($serialized)
  1444.     {
  1445.         if(is_string($serialized))
  1446.             $serialized=json_decode($serialized,true);
  1447.         if(!is_array($serialized))
  1448.             return;
  1449.         foreach ($serialized as $key => $val) {
  1450.             $prop $this->snakeToCamel($key);
  1451.             $f "set" ucfirst($prop);
  1452.             if (method_exists($this$f)) {
  1453.                 switch ($prop) {
  1454.                     case "bookingReservationStartDate":
  1455.                     case "bookingReservationEndDate":
  1456.                     case "bookingCheckInDate":
  1457.                     case "bookingCheckOutDate":
  1458.                     case "previousBookingCheckInDate":
  1459.                     case "nextBookingCheckOutDate":
  1460.                     case "nextBookingCheckInDate":
  1461.                     case "previousBookingCheckOutDate":
  1462.                     case "bookingExpectedCheckInDate":
  1463.                     case "bookingExpectedCheckOutDate":
  1464.                     case "bookingTemporaryCheckOutDate":
  1465.                     case "bookingBillingStartDate":
  1466.                     case "bookingBillingEndDate":
  1467.                     case "studentDateOfBirth":
  1468.                     case "occupantDateOfBirth":
  1469.                     case "startDate":
  1470.                     case "endDate":
  1471.                         if(!is_null($val))
  1472.                             $this->$f(new \DateTime($val));
  1473. //                            $this->$f(new \DateTime('2023-05-15 11:22:33'));
  1474.                         break;
  1475.                     case "bookingUuid":
  1476.                     case "previousBookingUuid":
  1477.                     case "nextBookingUuid":
  1478.                     case "bedUuid":
  1479.                     case "roomUuid":
  1480.                     case "buildingUuid":
  1481.                     case "floorUuid":
  1482.                     case "wingUuid":
  1483.                     case "studentUuid":
  1484.                     case "occupantUuid":
  1485.                     case "camperUuid":
  1486.                         //only load if not null
  1487.                         if(!empty($val))
  1488.                             $this->$f(Ulid::fromString($val));
  1489.                         else $this->$f(null);
  1490.                         break;
  1491.                     default:
  1492.                         $this->$f($val);
  1493.                         break;
  1494.                 }
  1495.             }
  1496.         }
  1497.     }
  1498. }