<?php/* * HotelXMl is the entity that represent one Hotel (either from local-api or from external-hotel-xml) */namespace App\Entity;use App\Repository\HotelXmlRepository;use App\Trait\SearchEngineOptimization;use DateTimeInterface;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: HotelXmlRepository::class)]class HotelXml{ use SearchEngineOptimization; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(nullable: true)] private ?int $starRating = null; #[ORM\Column(length: 255, nullable: true)] private ?string $imageUrl = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $description = null; #[ORM\Column(length: 255)] private ?string $code = null; // code Hotel #[ORM\Column(length: 255, nullable: true)] private ?string $codeExternal = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?DateTimeInterface $gdsRefreshDate = null; #[ORM\Column(length: 255)] private ?string $city = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: true)] private ?Product $product = null; // HotelContract or XmlApi #[ORM\Column(nullable: true)] private ?float $marginB2C = null; #[ORM\Column(nullable: true)] private ?float $marginB2B = null; #[ORM\Column(length: 255, nullable: true)] private ?string $country = null; #[ORM\OneToMany(mappedBy: 'hotelXml', targetEntity: HotelXmlPrice::class, cascade: ['remove'])] private $prices; #[ORM\ManyToOne] private ?Hotel $hotel = null; public function __construct() { $this->prices = 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 getStarRating(): ?int { return $this->starRating; } public function setStarRating(?int $starRating): self { $this->starRating = $starRating; return $this; } public function getImageUrl(): ?string { return $this->imageUrl; } public function setImageUrl(?string $imageUrl): self { $this->imageUrl = $imageUrl; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getCode(): ?string { return $this->code; } public function setCode(string $code): self { $this->code = $code; return $this; } public function getCodeExternal(): ?string { return $this->codeExternal; } public function setCodeExternal(?string $codeExternal): self { $this->codeExternal = $codeExternal; return $this; } public function getGdsRefreshDate(): ?DateTimeInterface { return $this->gdsRefreshDate; } public function setGdsRefreshDate(DateTimeInterface $gdsRefreshDate): self { $this->gdsRefreshDate = $gdsRefreshDate; return $this; } public function getCity(): ?string { return $this->city; } public function setCity(string $city): self { $this->city = $city; return $this; } public function getProduct(): ?Product { return $this->product; } public function setProduct(?Product $product): self { $this->product = $product; return $this; } public function getMarginB2C(): ?float { return $this->marginB2C; } public function setMarginB2C(?float $marginB2C): self { $this->marginB2C = $marginB2C; return $this; } public function getMarginB2B(): ?float { return $this->marginB2B; } public function setMarginB2B(?float $marginB2B): self { $this->marginB2B = $marginB2B; return $this; } public function __toString(): string { return $this->name; } public function getCountry(): ?string { return $this->country; } public function setCountry(?string $country): static { $this->country = $country; return $this; } public function resetPrices():static{ $this->prices = new ArrayCollection(); return $this; } public function getHotel(): ?Hotel { return $this->hotel; } public function setHotel(?Hotel $hotel): static { $this->hotel = $hotel; return $this; }}