src/Entity/HotelXml.php line 18

Open in your IDE?
  1. <?php
  2. /*
  3.  * HotelXMl is the entity that represent one Hotel (either from local-api or from external-hotel-xml)
  4.  */
  5. namespace App\Entity;
  6. use App\Repository\HotelXmlRepository;
  7. use App\Trait\SearchEngineOptimization;
  8. use DateTimeInterface;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\DBAL\Types\Types;
  12. use Doctrine\ORM\Mapping as ORM;
  13. #[ORM\Entity(repositoryClassHotelXmlRepository::class)]
  14. class HotelXml
  15. {
  16.     use SearchEngineOptimization;
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue]
  19.     #[ORM\Column]
  20.     private ?int $id null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $name null;
  23.     #[ORM\Column(nullabletrue)]
  24.     private ?int $starRating null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $imageUrl null;
  27.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  28.     private ?string $description null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $code null// code Hotel
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $codeExternal null;
  33.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  34.     private ?DateTimeInterface $gdsRefreshDate null;
  35.     #[ORM\Column(length255)]
  36.     private ?string $city null;
  37.     #[ORM\ManyToOne]
  38.     #[ORM\JoinColumn(nullabletrue)]
  39.     private ?Product $product null// HotelContract or XmlApi
  40.     #[ORM\Column(nullabletrue)]
  41.     private ?float $marginB2C null;
  42.     #[ORM\Column(nullabletrue)]
  43.     private ?float $marginB2B null;
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $country null;
  46.     #[ORM\OneToMany(mappedBy'hotelXml'targetEntityHotelXmlPrice::class, cascade: ['remove'])]
  47.     private $prices;
  48.     #[ORM\ManyToOne]
  49.     private ?Hotel $hotel null;
  50.     public function __construct()
  51.     {
  52.         $this->prices = new ArrayCollection();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getName(): ?string
  59.     {
  60.         return $this->name;
  61.     }
  62.     public function setName(string $name): self
  63.     {
  64.         $this->name $name;
  65.         return $this;
  66.     }
  67.     public function getStarRating(): ?int
  68.     {
  69.         return $this->starRating;
  70.     }
  71.     public function setStarRating(?int $starRating): self
  72.     {
  73.         $this->starRating $starRating;
  74.         return $this;
  75.     }
  76.     public function getImageUrl(): ?string
  77.     {
  78.         return $this->imageUrl;
  79.     }
  80.     public function setImageUrl(?string $imageUrl): self
  81.     {
  82.         $this->imageUrl $imageUrl;
  83.         return $this;
  84.     }
  85.     public function getDescription(): ?string
  86.     {
  87.         return $this->description;
  88.     }
  89.     public function setDescription(?string $description): self
  90.     {
  91.         $this->description $description;
  92.         return $this;
  93.     }
  94.     public function getCode(): ?string
  95.     {
  96.         return $this->code;
  97.     }
  98.     public function setCode(string $code): self
  99.     {
  100.         $this->code $code;
  101.         return $this;
  102.     }
  103.     public function getCodeExternal(): ?string
  104.     {
  105.         return $this->codeExternal;
  106.     }
  107.     public function setCodeExternal(?string $codeExternal): self
  108.     {
  109.         $this->codeExternal $codeExternal;
  110.         return $this;
  111.     }
  112.     public function getGdsRefreshDate(): ?DateTimeInterface
  113.     {
  114.         return $this->gdsRefreshDate;
  115.     }
  116.     public function setGdsRefreshDate(DateTimeInterface $gdsRefreshDate): self
  117.     {
  118.         $this->gdsRefreshDate $gdsRefreshDate;
  119.         return $this;
  120.     }
  121.     public function getCity(): ?string
  122.     {
  123.         return $this->city;
  124.     }
  125.     public function setCity(string $city): self
  126.     {
  127.         $this->city $city;
  128.         return $this;
  129.     }
  130.     public function getProduct(): ?Product
  131.     {
  132.         return $this->product;
  133.     }
  134.     public function setProduct(?Product $product): self
  135.     {
  136.         $this->product $product;
  137.         return $this;
  138.     }
  139.     public function getMarginB2C(): ?float
  140.     {
  141.         return $this->marginB2C;
  142.     }
  143.     public function setMarginB2C(?float $marginB2C): self
  144.     {
  145.         $this->marginB2C $marginB2C;
  146.         return $this;
  147.     }
  148.     public function getMarginB2B(): ?float
  149.     {
  150.         return $this->marginB2B;
  151.     }
  152.     public function setMarginB2B(?float $marginB2B): self
  153.     {
  154.         $this->marginB2B $marginB2B;
  155.         return $this;
  156.     }
  157.     public function __toString(): string
  158.     {
  159.         return $this->name;
  160.     }
  161.     public function getCountry(): ?string
  162.     {
  163.         return $this->country;
  164.     }
  165.     public function setCountry(?string $country): static
  166.     {
  167.         $this->country $country;
  168.         return $this;
  169.     }
  170.     public function resetPrices():static{
  171.         $this->prices = new ArrayCollection();
  172.         return $this;
  173.     }
  174.     public function getHotel(): ?Hotel
  175.     {
  176.         return $this->hotel;
  177.     }
  178.     public function setHotel(?Hotel $hotel): static
  179.     {
  180.         $this->hotel $hotel;
  181.         return $this;
  182.     }
  183.     public function getPrices(): Collection
  184.     {
  185.         return $this->prices;
  186.     }
  187. }