<?phpnamespace App\Entity;use App\Repository\CancellationPolicyRepository;use DateTimeInterface;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: CancellationPolicyRepository::class)]class CancellationPolicy{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 128)] private ?string $name; #[ORM\Column(type: 'smallint')] #[Assert\NotBlank] private ?int $minimumDaysBefore; #[ORM\ManyToOne(inversedBy: 'cancellationPolicies')] #[ORM\JoinColumn(nullable: false)] private ?HotelContract $hotelContract = null; #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 3)] #[Assert\NotNull] private ?float $feeValue = null; #[ORM\Column(length: 32)] private ?string $feeType = null; #[ORM\Column(length: 32)] private ?string $feeBase = null; #[ORM\Column(type: Types::DATE_MUTABLE)] #[Assert\NotNull] private ?DateTimeInterface $checkInStartDate = null; #[ORM\Column(type: Types::DATE_MUTABLE)] #[Assert\NotBlank] private ?DateTimeInterface $checkInEndDate = null; #[ORM\ManyToMany(targetEntity: HotelRoomType::class)] #[Assert\NotNull] private Collection $hrtCollection; public function __construct() { $this->hrtCollection = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getMinimumDaysBefore(): ?int { return $this->minimumDaysBefore; } public function setMinimumDaysBefore(int $minimumDaysBefore): self { $this->minimumDaysBefore = $minimumDaysBefore; return $this; } public function getHotelContract(): ?HotelContract { return $this->hotelContract; } public function setHotelContract(?HotelContract $hotelContract): self { $this->hotelContract = $hotelContract; return $this; } public function getFeeValue(): ?float { return $this->feeValue; } public function setFeeValue(float $feeValue): self { $this->feeValue = $feeValue; return $this; } public function getFeeType(): ?string { return $this->feeType; } public function setFeeType(string $feeType): self { $this->feeType = $feeType; return $this; } public function getFeeBase(): ?string { return $this->feeBase; } public function setFeeBase(string $feeBase): self { $this->feeBase = $feeBase; return $this; } public function getCheckInStartDate(): ?DateTimeInterface { return $this->checkInStartDate; } public function setCheckInStartDate(?DateTimeInterface $checkInStartDate): self { $this->checkInStartDate = $checkInStartDate; return $this; } public function getCheckInEndDate(): ?DateTimeInterface { return $this->checkInEndDate; } public function setCheckInEndDate(?DateTimeInterface $checkInEndDate): self { $this->checkInEndDate = $checkInEndDate; return $this; } /** * @return Collection<int, HotelRoomType> */ public function getHrtCollection(): Collection { return $this->hrtCollection; } public function addHrtCollection(HotelRoomType $hrt): self { if (!$this->hrtCollection->contains($hrt)) { $this->hrtCollection->add($hrt); } return $this; } public function removeHrtCollection(HotelRoomType $hrt): self { $this->hrtCollection->removeElement($hrt); return $this; }}