src/Entity/Utils/UnitFilters.php line 47

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Utils;
  3. class UnitFilters extends AccommodationTypeFilter {
  4.     /**
  5.      * @var int $resourceId
  6.      */
  7.     private $resourceId;
  8.     /**
  9.      * @var int|null $unitId
  10.      */
  11.     private $unitId;
  12.     /**
  13.      * @var array $unitArea
  14.      */
  15.     private $unitArea;
  16.     /**
  17.      * @var int $priceFrom
  18.      */
  19.     private $priceFrom;
  20.     /**
  21.      * @var int $priceTo
  22.      */
  23.     private $priceTo;
  24.     /**
  25.      * @var array $options
  26.      */
  27.     private $options;
  28.     /**
  29.      * @var array $bedrooms
  30.      */
  31.     private $bedrooms;
  32.     /**
  33.      * @var array $unitIds
  34.      */
  35.     private $unitIds;
  36.     public function __construct(
  37.         int $resortId,
  38.         int $distributionChannelId,
  39.         string $arrivalDate "",
  40.         string $departureDate "",
  41.         int $numberOfBedrooms 0,
  42.         int $category 0,
  43.         bool $withTerrace false,
  44.         bool $withAirConditioning false,
  45.         bool $withAnimals false,
  46.         bool $withPRM false,
  47.         string $lang "fr",
  48.         string  $originalLang "fr",
  49.         ?string $accoCode null,
  50.         int $capacity 1,
  51.         int $resourceId,
  52.         int $unitId null,
  53.         array $unitArea = [],
  54.         int $priceFrom 0,
  55.         int $priceTo 0,
  56.         array $options = [],
  57.         array $bedrooms = []
  58.     ) {
  59.         parent::__construct(
  60.             $resortId,
  61.             $distributionChannelId,
  62.             $arrivalDate,
  63.             $departureDate,
  64.             $numberOfBedrooms,
  65.             $category,
  66.             $withTerrace,
  67.             $withAirConditioning,
  68.             $withAnimals,
  69.             $withPRM,
  70.             $lang,
  71.             $originalLang,
  72.             $accoCode,
  73.             $capacity
  74.         );
  75.         $this->resourceId $resourceId;
  76.         $this->unitId $unitId;
  77.         $this->unitArea $unitArea;
  78.         $this->priceFrom $priceFrom;
  79.         $this->priceTo $priceTo;
  80.         $this->options $options;
  81.         $this->bedrooms $bedrooms;
  82.         $this->unitIds = [];
  83.     }
  84.     /**
  85.      * @return int
  86.      */
  87.     public function getResourceId(): int {
  88.         return $this->resourceId;
  89.     }
  90.     /**
  91.      * @param int $resourceId
  92.      */
  93.     public function setResourceId(int $resourceId): void {
  94.         $this->resourceId $resourceId;
  95.     }
  96.     /**
  97.      * @return int|null
  98.      */
  99.     public function getUnitId(): ?int {
  100.         return $this->unitId;
  101.     }
  102.     /**
  103.      * @param int|null $unitId
  104.      */
  105.     public function setUnitId(?int $unitId): void {
  106.         $this->unitId $unitId;
  107.     }
  108.     /**
  109.      * @return array
  110.      */
  111.     public function getUnitArea(): array {
  112.         return $this->unitArea;
  113.     }
  114.     /**
  115.      * @param array $unitArea
  116.      */
  117.     public function setUnitArea(array $unitArea): void {
  118.         $this->unitArea $unitArea;
  119.     }
  120.     /**
  121.      * @return int
  122.      */
  123.     public function getPriceFrom(): int {
  124.         return $this->priceFrom;
  125.     }
  126.     /**
  127.      * @param int $priceFrom
  128.      */
  129.     public function setPriceFrom(int $priceFrom): void {
  130.         $this->priceFrom $priceFrom;
  131.     }
  132.     /**
  133.      * @return int
  134.      */
  135.     public function getPriceTo(): int {
  136.         return $this->priceTo;
  137.     }
  138.     /**
  139.      * @param int $priceTo
  140.      */
  141.     public function setPriceTo(int $priceTo): void {
  142.         $this->priceTo $priceTo;
  143.     }
  144.     /**
  145.      * @return array
  146.      */
  147.     public function getOptions(): array {
  148.         return $this->options;
  149.     }
  150.     /**
  151.      * @param array $options
  152.      */
  153.     public function setOptions(array $options): void {
  154.         $this->options $options;
  155.     }
  156.     /**
  157.      * @return array
  158.      */
  159.     public function getUnitIds(): array {
  160.         return $this->unitIds;
  161.     }
  162.     /**
  163.      * @param array $unitIds
  164.      */
  165.     public function setUnitIds(array $unitIds): void {
  166.         $this->unitIds $unitIds;
  167.     }
  168.     /**
  169.      * @return bool
  170.      */
  171.     public function hasUnitIds(): bool
  172.     {
  173.         return !empty($this->unitIds);
  174.     }
  175.     /**
  176.      * @return array
  177.      */
  178.     public function getBedrooms(): array {
  179.         return $this->bedrooms;
  180.     }
  181.     /**
  182.      * @param array $bedrooms
  183.      */
  184.     public function setBedrooms(array $bedrooms): void {
  185.         $this->bedrooms $bedrooms;
  186.     }
  187. }