src/Entity/HotelXml.php line 17

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