src/Entity/CancellationPolicy.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CancellationPolicyRepository;
  4. use DateTimeInterface;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. #[ORM\Entity(repositoryClassCancellationPolicyRepository::class)]
  11. class CancellationPolicy
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     private $id;
  17.     #[ORM\Column(type'string'length128)]
  18.     private ?string $name;
  19.     #[ORM\Column(type'smallint')]
  20.     #[Assert\NotBlank]
  21.     private ?int $minimumDaysBefore;
  22.     #[ORM\ManyToOne(inversedBy'cancellationPolicies')]
  23.     #[ORM\JoinColumn(nullablefalse)]
  24.     private ?HotelContract $hotelContract null;
  25.     #[ORM\Column(typeTypes::DECIMALprecision10scale3)]
  26.     #[Assert\NotNull]
  27.     private ?float $feeValue null;
  28.     #[ORM\Column(length32)]
  29.     private ?string $feeType null;
  30.     #[ORM\Column(length32)]
  31.     private ?string $feeBase null;
  32.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  33.     #[Assert\NotNull]
  34.     private ?DateTimeInterface $checkInStartDate null;
  35.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  36.     #[Assert\NotBlank]
  37.     private ?DateTimeInterface $checkInEndDate null;
  38.     #[ORM\ManyToMany(targetEntityHotelRoomType::class)]
  39.     #[Assert\NotNull]
  40.     private Collection $hrtCollection;
  41.     public function __construct()
  42.     {
  43.         $this->hrtCollection = new ArrayCollection();
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getName(): ?string
  50.     {
  51.         return $this->name;
  52.     }
  53.     public function setName(?string $name): self
  54.     {
  55.         $this->name $name;
  56.         return $this;
  57.     }
  58.     public function getMinimumDaysBefore(): ?int
  59.     {
  60.         return $this->minimumDaysBefore;
  61.     }
  62.     public function setMinimumDaysBefore(int $minimumDaysBefore): self
  63.     {
  64.         $this->minimumDaysBefore $minimumDaysBefore;
  65.         return $this;
  66.     }
  67.     public function getHotelContract(): ?HotelContract
  68.     {
  69.         return $this->hotelContract;
  70.     }
  71.     public function setHotelContract(?HotelContract $hotelContract): self
  72.     {
  73.         $this->hotelContract $hotelContract;
  74.         return $this;
  75.     }
  76.     public function getFeeValue(): ?float
  77.     {
  78.         return $this->feeValue;
  79.     }
  80.     public function setFeeValue(float $feeValue): self
  81.     {
  82.         $this->feeValue $feeValue;
  83.         return $this;
  84.     }
  85.     public function getFeeType(): ?string
  86.     {
  87.         return $this->feeType;
  88.     }
  89.     public function setFeeType(string $feeType): self
  90.     {
  91.         $this->feeType $feeType;
  92.         return $this;
  93.     }
  94.     public function getFeeBase(): ?string
  95.     {
  96.         return $this->feeBase;
  97.     }
  98.     public function setFeeBase(string $feeBase): self
  99.     {
  100.         $this->feeBase $feeBase;
  101.         return $this;
  102.     }
  103.     public function getCheckInStartDate(): ?DateTimeInterface
  104.     {
  105.         return $this->checkInStartDate;
  106.     }
  107.     public function setCheckInStartDate(?DateTimeInterface $checkInStartDate): self
  108.     {
  109.         $this->checkInStartDate $checkInStartDate;
  110.         return $this;
  111.     }
  112.     public function getCheckInEndDate(): ?DateTimeInterface
  113.     {
  114.         return $this->checkInEndDate;
  115.     }
  116.     public function setCheckInEndDate(?DateTimeInterface $checkInEndDate): self
  117.     {
  118.         $this->checkInEndDate $checkInEndDate;
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, HotelRoomType>
  123.      */
  124.     public function getHrtCollection(): Collection
  125.     {
  126.         return $this->hrtCollection;
  127.     }
  128.     public function addHrtCollection(HotelRoomType $hrt): self
  129.     {
  130.         if (!$this->hrtCollection->contains($hrt)) {
  131.             $this->hrtCollection->add($hrt);
  132.         }
  133.         return $this;
  134.     }
  135.     public function removeHrtCollection(HotelRoomType $hrt): self
  136.     {
  137.         $this->hrtCollection->removeElement($hrt);
  138.         return $this;
  139.     }
  140. }