src/Entity/Residence/BookingChangeRequestFilter.php line 338

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Residence;
  3. use App\Entity\Camper\CamperProfile;
  4. use App\Entity\School\Student\StudentProfile;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. class BookingChangeRequestFilter implements \ArrayAccess\Serializable\JsonSerializable
  7. {
  8.     private ?Building $building null;
  9.     private ?Floor $floor null;
  10.     private ?Wing $wing null;
  11.     private ?string $extra null;
  12.     private ?string $modal null;
  13.     private \DateTimeInterface $startdate;
  14.     private \DateTimeInterface $enddate;
  15.     private ?Beds $bedspace=null;
  16.     private ?OccupantInterface $occupant=null;
  17.     private ?StudentProfile $student=null;
  18.     private ?CamperProfile $camper=null;
  19.     private ?string $requestStatus=null;
  20.     private ?string $approvalStatus=null;
  21.     private ?bool $forCamper=null;
  22.         private ?string $query=null;
  23.         // from meeeting
  24.     private ?bool $gender=null;
  25.     private ?bool $country=null;
  26.     private ?bool $yaa=null;
  27.     // added from meeting
  28.     private ?bool $Group=null;
  29.     private ?bool $ArrivalDate=null;
  30.     public function __construct()
  31.     {
  32.         $this->startdate=new \DateTime();
  33.         $this->enddate=new \DateTime();
  34.     }
  35.     public function getBuilding(): ?Building
  36.     {
  37.         return $this->building;
  38.     }
  39.     /**
  40.      * @param Building|null $building
  41.      *
  42.      * @return RoomFilter
  43.      */
  44.     public function setBuilding(?Building $building): BookingChangeRequestFilter
  45.     {
  46.         $this->building $building;
  47.         return $this;
  48.     }
  49.     public function getFloor(): ?Floor
  50.     {
  51.         return $this->floor;
  52.     }
  53.     /**
  54.      * @param Floor|null $floor
  55.      *
  56.      * @return RoomFilter
  57.      */
  58.     public function setFloor(?Floor $floor): BookingChangeRequestFilter
  59.     {
  60.         $this->floor $floor;
  61.         return $this;
  62.     }
  63.     public function getWing(): ?Wing
  64.     {
  65.         return $this->wing;
  66.     }
  67.     /**
  68.      * @param Wing|null $wing
  69.      *
  70.      * @return RoomFilter
  71.      */
  72.     public function setWing(?Wing $wing): BookingChangeRequestFilter
  73.     {
  74.         $this->wing $wing;
  75.         return $this;
  76.     }
  77.     public function getExtra(): ?string
  78.     {
  79.         return $this->extra;
  80.     }
  81.     /**
  82.      * @param string|null $extra
  83.      *
  84.      * @return RoomFilter
  85.      */
  86.     public function setExtra(?string $extra): BookingChangeRequestFilter
  87.     {
  88.         $this->extra $extra;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return string|null
  93.      */
  94.     public function getModal(): ?string
  95.     {
  96.         return $this->modal;
  97.     }
  98.     /**
  99.      * @param string|null $modal
  100.      *
  101.      * @return RoomFilter
  102.      */
  103.     public function setModal(?string $modal): BookingChangeRequestFilter
  104.     {
  105.         $this->modal $modal;
  106.         return $this;
  107.     }
  108.     /**
  109.      * @param string|null $modal
  110.      */
  111.     /**
  112.      * @return \DateTime
  113.      */
  114.     public function getStartdate(): \DateTime
  115.     {
  116.         return $this->startdate;
  117.     }
  118.     /**
  119.      * @param \DateTime $startdate
  120.      *
  121.      * @return RoomFilter
  122.      */
  123.     public function setStartdate(\DateTime $startdate): BookingChangeRequestFilter
  124.     {
  125.         $this->startdate $startdate;
  126.         return $this;
  127.     }
  128.     /**
  129.      * @param \DateTime $startdate
  130.      */
  131.     /**
  132.      * @return \DateTime
  133.      */
  134.     public function getEnddate(): \DateTime
  135.     {
  136.         return $this->enddate;
  137.     }
  138.     /**
  139.      * @param \DateTime $enddate
  140.      *
  141.      * @return RoomFilter
  142.      */
  143.     public function setEnddate(\DateTime $enddate): BookingChangeRequestFilter
  144.     {
  145.         $this->enddate $enddate;
  146.         return $this;
  147.     }
  148.     /**
  149.      * @param \DateTime $enddate
  150.      */
  151.     /**
  152.      * @return Beds|null
  153.      */
  154.     public function getBedspace(): ?Beds
  155.     {
  156.         return $this->bedspace;
  157.     }
  158.     /**
  159.      * @param Beds|null $bedspace
  160.      * @return RoomFilter
  161.      */
  162.     public function setBedspace(?Beds $bedspace): BookingChangeRequestFilter
  163.     {
  164.         $this->bedspace $bedspace;
  165.         return $this;
  166.     }
  167.     /**
  168.      * @return Occupancy|null
  169.      */
  170.     public function getOccupant(): ?OccupantInterface
  171.     {
  172.         return $this->occupant;
  173.     }
  174.     /**
  175.      * @param OccupantInterface|null $occupant
  176.      *
  177.      * @return RoomFilter
  178.      */
  179.     public function setOccupant(?OccupantInterface $occupant): BookingChangeRequestFilter
  180.     {
  181.         $this->occupant $occupant;
  182.         if($occupant instanceof StudentProfile)
  183.             $this->student=$occupant;
  184.         if($occupant instanceof CamperProfile)
  185.             $this->camper=$occupant;
  186.         return $this;
  187.     }
  188.     public function getForCamper(): ?bool
  189.     {
  190.         return $this->forCamper;
  191.     }
  192.     public function setForCamper(?bool $forCamper): void
  193.     {
  194.         $this->forCamper $forCamper;
  195.     }
  196.     public function getStudent(): ?StudentProfile
  197.     {
  198.         return $this->student;
  199.     }
  200.     public function setStudent(?StudentProfile $student): BookingChangeRequestFilter
  201.     {
  202.         $this->student $student;
  203.         return $this;
  204.     }
  205.     public function getCamper(): ?CamperProfile
  206.     {
  207.         return $this->camper;
  208.     }
  209.     public function setCamper(?CamperProfile $camper): BookingChangeRequestFilter
  210.     {
  211.         $this->camper $camper;
  212.         return $this;
  213.     }
  214.     /**
  215.      * @return string|null
  216.      */
  217.     public function getQuery(): ?string
  218.     {
  219.         return $this->query;
  220.     }
  221.     /**
  222.      * @param string|null $query
  223.      * @return RoomFilter
  224.      */
  225.     public function setQuery(?string $query): BookingChangeRequestFilter
  226.     {
  227.         $this->query $query;
  228.         return $this;
  229.     }
  230.     public function getRequestStatus(): ?string
  231.     {
  232.         return $this->requestStatus;
  233.     }
  234.     public function setRequestStatus(?string $requestStatus): BookingChangeRequestFilter
  235.     {
  236.         $this->requestStatus $requestStatus;
  237.         return $this;
  238.     }
  239.     public function getApprovalStatus(): ?string
  240.     {
  241.         return $this->approvalStatus;
  242.     }
  243.     public function setApprovalStatus(?string $approvalStatus): BookingChangeRequestFilter
  244.     {
  245.         $this->approvalStatus $approvalStatus;
  246.         return $this;
  247.     }
  248.     public function getGender(): ?bool
  249.     {
  250.         return $this->gender;
  251.     }
  252.     public function setGender(?bool $gender): BookingChangeRequestFilter
  253.     {
  254.         $this->gender $gender;
  255.         return $this;
  256.     }
  257.     public function offsetSet($offset$value)
  258.     {
  259.         if (is_null($offset)) {
  260.             $this->container[] = $value;
  261.         } else {
  262.             $this->container[$offset] = $value;
  263.         }
  264.     }
  265.     public function offsetExists($offset)
  266.     {
  267.         return isset($this->container[$offset]);
  268.     }
  269.     public function offsetUnset($offset)
  270.     {
  271.         unset($this->container[$offset]);
  272.     }
  273.     public function offsetGet($offset)
  274.     {
  275.         return isset($this->container[$offset]) ? $this->container[$offset] : null;
  276.     }
  277.     public function jsonSerialize()
  278.     {
  279.         return get_object_vars($this);
  280.     }
  281.     public function serialize()
  282.     {
  283.         return serialize(get_object_vars($this));
  284.     }
  285.     public function unserialize($serialized)
  286.     {
  287. //        dd($serialized);
  288.         $properties get_object_vars($this);
  289.         $obj json_decode($serialized);
  290.         if (!is_object($obj)) {
  291.             return;
  292.         }
  293.         foreach ($properties as $property => $value) {
  294. //            if(array_key_exists($property,$obj))
  295.             if (property_exists($obj$property)) {
  296.                 switch($property) {
  297.                     case "startdate":
  298.                     case "enddate":
  299.                         break;
  300.                         $this->$property = new \DateTime($obj->$property);
  301.                     default:
  302.                         $this->$property $obj->$property;
  303.                         break;
  304.                 }
  305.             }
  306.         }
  307.     }
  308. }