src/Entity/Hotel.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\AclPermission\Annotation\AclPermission;
  4. use App\Repository\HotelRepository;
  5. use App\Validator\UniqueSubdomain;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  10. use Symfony\Component\HttpFoundation\File\File;
  11. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  12. /**
  13.  * @Vich\Uploadable
  14.  * @ORM\Entity(repositoryClass=HotelRepository::class)
  15.  * @UniqueSubdomain
  16.  * @AclPermission(scopes={"class", "object"}, permissions={"VIEW", "CREATE", "EDIT", "DELETE"}, permissionsOnlyForClassScope={"CREATE"}, position=1)
  17.  */
  18. class Hotel extends BehaviorsMappedSuperclass
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\Column(type="uuid", unique=true)
  23.      * @ORM\GeneratedValue(strategy="CUSTOM")
  24.      * @ORM\CustomIdGenerator(class=UuidGenerator::class)
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $name;
  31.     /**
  32.      * @ORM\Column(type="text", nullable=true)
  33.      */
  34.     private $description;
  35.     /**
  36.      * @ORM\Column(type="integer", nullable=true)
  37.      */
  38.     private $tax;
  39.     /**
  40.      * @ORM\ManyToMany(targetEntity=User::class, inversedBy="hotels")
  41.      * @ORM\JoinTable(name="user_hotel")
  42.      */
  43.     private $users;
  44.     /**
  45.      * @ORM\ManyToMany(targetEntity=TourOperator::class, mappedBy="hotels")
  46.      * @ORM\JoinTable(name="hotel_tour_operator")
  47.      */
  48.     private $tourOperators;
  49.     /**
  50.      * @ORM\OneToMany(targetEntity=Department::class, mappedBy="hotel")
  51.      */
  52.     private $departments;
  53.     /**
  54.      * @ORM\OneToMany(targetEntity=Report::class, mappedBy="hotel")
  55.      */
  56.     private $reports;
  57.     /**
  58.      * @ORM\OneToMany(targetEntity=Detail::class, mappedBy="hotel")
  59.      */
  60.     private $details;
  61.     /**
  62.      * @ORM\OneToMany(targetEntity=Reporting::class, mappedBy="hotel")
  63.      */
  64.     private $reportings;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity=Room::class, mappedBy="hotel")
  67.      */
  68.     private $rooms;
  69.     /**
  70.      * @ORM\ManyToMany(targetEntity=Guest::class, mappedBy="hotels")
  71.      * @ORM\JoinTable(name="hotel_guest")
  72.      */
  73.     private $guests;
  74.     /**
  75.      * @ORM\OneToMany(targetEntity=Restaurant::class, mappedBy="hotel")
  76.      */
  77.     private $restaurants;
  78.     /**
  79.      * @ORM\OneToMany(targetEntity=Ticket::class, mappedBy="hotel")
  80.      */
  81.     private $tickets;
  82.     /**
  83.      * @ORM\OneToMany(targetEntity=Product::class, mappedBy="hotel")
  84.      */
  85.     private $products;
  86.     /**
  87.      * @ORM\ManyToOne(targetEntity=Complex::class, inversedBy="hotels")
  88.      * @ORM\JoinColumn(nullable=false)
  89.      */
  90.     private $complex;
  91.     /**
  92.      * @ORM\ManyToMany(targetEntity=User::class, inversedBy="assignedHotels")
  93.      * @ORM\JoinTable(name="user_hotel_assigned")
  94.      */
  95.     private $assignedUsers;
  96.     /**
  97.      * @ORM\ManyToOne(targetEntity=User::class, cascade={"persist", "remove"}, fetch="EAGER")
  98.      * @ORM\JoinColumn(nullable=false)
  99.      */
  100.     private $blameableUser;
  101.     /**
  102.      * @ORM\ManyToMany(targetEntity=Media::class, cascade={"persist"})
  103.      */
  104.     private $medias;
  105.     /**
  106.      * @ORM\OneToMany(targetEntity=Group::class, mappedBy="hotel")
  107.      */
  108.     private $groups;
  109.     /**
  110.      * @ORM\Column(type="string", length=255, unique=true)
  111.      */
  112.     private $subdomain;
  113.     /**
  114.      * @ORM\Column(type="string", length=255, nullable=true)
  115.      */
  116.     private $pmsConnection;
  117.     /**
  118.      * @ORM\Column(type="text", nullable=true)
  119.      */
  120.     private $pmsForbiddenEmailDomains;
  121.     /**
  122.      * @ORM\OneToMany(targetEntity=Order::class, mappedBy="hotel")
  123.      */
  124.     private $orders;
  125.     /**
  126.      * @ORM\OneToMany(targetEntity=Invoice::class, mappedBy="hotel")
  127.      */
  128.     private $invoices;
  129.     /**
  130.      * @ORM\Column(type="string", length=255, nullable=true)
  131.      */
  132.     private $address1;
  133.     /**
  134.      * @ORM\Column(type="string", length=255, nullable=true)
  135.      */
  136.     private $address2;
  137.     /**
  138.      * @ORM\Column(type="string", length=20, nullable=true)
  139.      */
  140.     private $postalCode;
  141.     /**
  142.      * @ORM\Column(type="string", length=255, nullable=true)
  143.      */
  144.     private $city;
  145.     /**
  146.      * @ORM\Column(type="string", length=255, nullable=true)
  147.      */
  148.     private $state;
  149.     /**
  150.      * @ORM\Column(type="string", length=255, nullable=true)
  151.      */
  152.     private $country;
  153.     /**
  154.      * @ORM\Column(type="string", length=50, nullable=true)
  155.      */
  156.     private $tin;
  157.     /**
  158.      * @ORM\Column(type="string", length=255, nullable=true)
  159.      */
  160.     private $fiscalName;
  161.     /**
  162.      * @ORM\Column(type="string", length=20, nullable=true)
  163.      */
  164.     private $invoiceSerie;
  165.     /**
  166.      * @ORM\OneToMany(targetEntity=Page::class, mappedBy="hotel")
  167.      * @ORM\OrderBy({"sortOrder" = "ASC"})
  168.      */
  169.     private $pages;
  170.     /**
  171.      * @ORM\Column(type="string", length=255, nullable=true)
  172.      */
  173.     private $replyToEmail;
  174.     /**
  175.      * @ORM\Column(type="string", length=255, nullable=true)
  176.      */
  177.     private $orderEmailsTo;
  178.     /**
  179.      * @ORM\Column(type="boolean")
  180.      */
  181.     private $countInfantsForRestaurantReserves;
  182.     /**
  183.      * @ORM\Column(type="boolean")
  184.      */
  185.     private $errorsMuted;
  186.     /**
  187.      * @ORM\Column(type="string", length=255, nullable=true)
  188.      */
  189.     private $stripePublishableKey;
  190.     /**
  191.      * @ORM\Column(type="string", length=255, nullable=true)
  192.      */
  193.     private $stripeSecretKey;
  194.     /**
  195.      * @ORM\Column(type="string", length=255, nullable=true)
  196.      */
  197.     private $googleTagStreamId;
  198.     /**
  199.      * @ORM\Column(type="string", length=255, nullable=true)
  200.      */
  201.     private $googleTagMeasurementId;
  202.     /**
  203.      * @ORM\Column(type="integer", nullable=true)
  204.      */
  205.     private $restaurantReserveHomePosition;
  206.     /**
  207.      * @ORM\Column(type="integer", nullable=true)
  208.      */
  209.     private $createTicketHomePosition;
  210.     /**
  211.      * @ORM\Column(type="string", length=255, nullable=true)
  212.      * @var string
  213.      */
  214.     private $restaurantReserveHomeImage;
  215.     /**
  216.      * @Vich\UploadableField(mapping="hotel", fileNameProperty="restaurantReserveHomeImage")
  217.      * @var File
  218.      */
  219.     private $restaurantReserveHomeImageFile;
  220.     /**
  221.      * @ORM\Column(type="string", length=255, nullable=true)
  222.      * @var string
  223.      */
  224.     private $createTicketHomeImage;
  225.     /**
  226.      * @Vich\UploadableField(mapping="hotel", fileNameProperty="createTicketHomeImage")
  227.      * @var File
  228.      */
  229.     private $createTicketHomeImageFile;
  230.     /**
  231.      * @ORM\Column(type="datetime", nullable=true)
  232.      */
  233.     private $lastPmsUpdatedAt;
  234.     /**
  235.      * @ORM\ManyToOne(targetEntity=User::class)
  236.      */
  237.     private $ticketCallAssignedUser;
  238.     /**
  239.      * @ORM\OneToMany(targetEntity=WiFiPremium::class, mappedBy="hotel")
  240.      */
  241.     private $wiFiPremiums;
  242.     /**
  243.      * @ORM\Column(type="boolean")
  244.      */
  245.     private $greenApiActive;
  246.     /**
  247.      * @ORM\Column(type="string", length=255, nullable=true)
  248.      */
  249.     private $greenApiId;
  250.     /**
  251.      * @ORM\Column(type="string", length=255, nullable=true)
  252.      */
  253.     private $greenApiToken;
  254.     public function __construct()
  255.     {
  256.         $this->users = new ArrayCollection();
  257.         $this->assignedUsers = new ArrayCollection();
  258.         $this->tourOperators = new ArrayCollection();
  259.         $this->departments = new ArrayCollection();
  260.         $this->reports = new ArrayCollection();
  261.         $this->details = new ArrayCollection();
  262.         $this->rooms = new ArrayCollection();
  263.         $this->guests = new ArrayCollection();
  264.         $this->restaurants = new ArrayCollection();
  265.         $this->tickets = new ArrayCollection();
  266.         $this->products = new ArrayCollection();
  267.         $this->medias = new ArrayCollection();
  268.         $this->groups = new ArrayCollection();
  269.         $this->orders = new ArrayCollection();
  270.         $this->invoices = new ArrayCollection();
  271.         $this->pages = new ArrayCollection();
  272.         $this->wiFiPremiums = new ArrayCollection();
  273.         $this->countInfantsForRestaurantReserves false;
  274.         $this->errorsMuted false;
  275.         $this->greenApiActive false;
  276.     }
  277.     public function __toString(): string
  278.     {
  279.         return $this->getName();
  280.     }
  281.     public function getId()
  282.     {
  283.         return $this->id;
  284.     }
  285.     public function getName(): ?string
  286.     {
  287.         return $this->name;
  288.     }
  289.     public function setName(string $name): self
  290.     {
  291.         $this->name $name;
  292.         return $this;
  293.     }
  294.     public function getDescription(): ?string
  295.     {
  296.         return $this->description;
  297.     }
  298.     public function setDescription(?string $description): self
  299.     {
  300.         $this->description $description;
  301.         return $this;
  302.     }
  303.     public function getTax(): ?int
  304.     {
  305.         return $this->tax;
  306.     }
  307.     public function setTax(?int $tax): self
  308.     {
  309.         $this->tax $tax;
  310.         return $this;
  311.     }
  312.     /**
  313.      * @return Collection|User[]
  314.      */
  315.     public function getUsers(): Collection
  316.     {
  317.         return $this->users;
  318.     }
  319.     public function addUser(User $user): self
  320.     {
  321.         if (!$this->users->contains($user)) {
  322.             $this->users[] = $user;
  323.         }
  324.         return $this;
  325.     }
  326.     public function removeUser(User $user): self
  327.     {
  328.         $this->users->removeElement($user);
  329.         return $this;
  330.     }
  331.     /**
  332.      * @return Collection|TourOperator[]
  333.      */
  334.     public function getTourOperators(): Collection
  335.     {
  336.         return $this->tourOperators;
  337.     }
  338.     public function addTourOperator(TourOperator $tourOperator): self
  339.     {
  340.         if (!$this->tourOperators->contains($tourOperator)) {
  341.             $this->tourOperators[] = $tourOperator;
  342.             $tourOperator->addHotel($this);
  343.         }
  344.         return $this;
  345.     }
  346.     public function removeTourOperator(TourOperator $tourOperator): self
  347.     {
  348.         if ($this->tourOperators->removeElement($tourOperator)) {
  349.             $tourOperator->removeHotel($this);
  350.         }
  351.         return $this;
  352.     }
  353.     /**
  354.      * @return Collection|Department[]
  355.      */
  356.     public function getDepartments(): Collection
  357.     {
  358.         return $this->departments;
  359.     }
  360.     public function addDepartment(Department $department): self
  361.     {
  362.         if (!$this->departments->contains($department)) {
  363.             $this->departments[] = $department;
  364.             $department->setHotel($this);
  365.         }
  366.         return $this;
  367.     }
  368.     public function removeDepartment(Department $department): self
  369.     {
  370.         if ($this->departments->removeElement($department)) {
  371.             // set the owning side to null (unless already changed)
  372.             if ($department->getHotel() === $this) {
  373.                 $department->setHotel(null);
  374.             }
  375.         }
  376.         return $this;
  377.     }
  378.     /**
  379.      * @return Collection|Report[]
  380.      */
  381.     public function getReports(): Collection
  382.     {
  383.         return $this->reports;
  384.     }
  385.     public function addReport(Report $report): self
  386.     {
  387.         if (!$this->reports->contains($report)) {
  388.             $this->reports[] = $report;
  389.             $report->setHotel($this);
  390.         }
  391.         return $this;
  392.     }
  393.     public function removeReport(Report $report): self
  394.     {
  395.         if ($this->reports->removeElement($report)) {
  396.             // set the owning side to null (unless already changed)
  397.             if ($report->getHotel() === $this) {
  398.                 $report->setHotel(null);
  399.             }
  400.         }
  401.         return $this;
  402.     }
  403.     /**
  404.      * @return Collection|Detail[]
  405.      */
  406.     public function getDetails(): Collection
  407.     {
  408.         return $this->details;
  409.     }
  410.     public function addDetail(Detail $detail): self
  411.     {
  412.         if (!$this->details->contains($detail)) {
  413.             $this->details[] = $detail;
  414.             $detail->setHotel($this);
  415.         }
  416.         return $this;
  417.     }
  418.     public function removeDetail(Detail $detail): self
  419.     {
  420.         if ($this->details->removeElement($detail)) {
  421.             // set the owning side to null (unless already changed)
  422.             if ($detail->getHotel() === $this) {
  423.                 $detail->setHotel(null);
  424.             }
  425.         }
  426.         return $this;
  427.     }
  428.     /**
  429.      * @return Collection|Reporting[]
  430.      */
  431.     public function getReportings(): Collection
  432.     {
  433.         return $this->reportings;
  434.     }
  435.     public function addReporting(Reporting $reporting): self
  436.     {
  437.         if (!$this->reportings->contains($reporting)) {
  438.             $this->reportings[] = $reporting;
  439.             $reporting->setHotel($this);
  440.         }
  441.         return $this;
  442.     }
  443.     public function removeReporting(Reporting $reporting): self
  444.     {
  445.         if ($this->reportings->removeElement($reporting)) {
  446.             // set the owning side to null (unless already changed)
  447.             if ($reporting->getHotel() === $this) {
  448.                 $reporting->setHotel(null);
  449.             }
  450.         }
  451.         return $this;
  452.     }
  453.     /**
  454.      * @return Collection|Room[]
  455.      */
  456.     public function getRooms(): Collection
  457.     {
  458.         return $this->rooms;
  459.     }
  460.     public function addRoom(Room $room): self
  461.     {
  462.         if (!$this->rooms->contains($room)) {
  463.             $this->rooms[] = $room;
  464.             $room->setHotel($this);
  465.         }
  466.         return $this;
  467.     }
  468.     public function removeRoom(Room $room): self
  469.     {
  470.         if ($this->rooms->removeElement($room)) {
  471.             // set the owning side to null (unless already changed)
  472.             if ($room->getHotel() === $this) {
  473.                 $room->setHotel(null);
  474.             }
  475.         }
  476.         return $this;
  477.     }
  478.     /**
  479.      * @return Collection|Guest[]
  480.      */
  481.     public function getGuests(): Collection
  482.     {
  483.         return $this->guests;
  484.     }
  485.     public function addGuest(Guest $guest): self
  486.     {
  487.         if (!$this->guests->contains($guest)) {
  488.             $this->guests[] = $guest;
  489.             $guest->addHotel($this);
  490.         }
  491.         return $this;
  492.     }
  493.     public function removeGuest(Guest $guest): self
  494.     {
  495.         if ($this->guests->removeElement($guest)) {
  496.             $guest->removeHotel($this);
  497.         }
  498.         return $this;
  499.     }
  500.     /**
  501.      * @return Collection|Restaurant[]
  502.      */
  503.     public function getRestaurants(): Collection
  504.     {
  505.         return $this->restaurants;
  506.     }
  507.     public function addRestaurant(Restaurant $restaurant): self
  508.     {
  509.         if (!$this->restaurants->contains($restaurant)) {
  510.             $this->restaurants[] = $restaurant;
  511.             $restaurant->setHotel($this);
  512.         }
  513.         return $this;
  514.     }
  515.     public function removeRestaurant(Restaurant $restaurant): self
  516.     {
  517.         if ($this->restaurants->removeElement($restaurant)) {
  518.             // set the owning side to null (unless already changed)
  519.             if ($restaurant->getHotel() === $this) {
  520.                 $restaurant->setHotel(null);
  521.             }
  522.         }
  523.         return $this;
  524.     }
  525.     /**
  526.      * @return Collection|Ticket[]
  527.      */
  528.     public function getTickets(): Collection
  529.     {
  530.         return $this->tickets;
  531.     }
  532.     public function addTicket(Ticket $ticket): self
  533.     {
  534.         if (!$this->tickets->contains($ticket)) {
  535.             $this->tickets[] = $ticket;
  536.             $ticket->setHotel($this);
  537.         }
  538.         return $this;
  539.     }
  540.     public function removeTicket(Ticket $ticket): self
  541.     {
  542.         if ($this->tickets->removeElement($ticket)) {
  543.             // set the owning side to null (unless already changed)
  544.             if ($ticket->getHotel() === $this) {
  545.                 $ticket->setHotel(null);
  546.             }
  547.         }
  548.         return $this;
  549.     }
  550.     /**
  551.      * @return Collection|Product[]
  552.      */
  553.     public function getProducts(): Collection
  554.     {
  555.         return $this->products;
  556.     }
  557.     public function addProduct(Product $product): self
  558.     {
  559.         if (!$this->products->contains($product)) {
  560.             $this->products[] = $product;
  561.             $product->setHotel($this);
  562.         }
  563.         return $this;
  564.     }
  565.     public function removeProduct(Product $product): self
  566.     {
  567.         if ($this->products->removeElement($product)) {
  568.             // set the owning side to null (unless already changed)
  569.             if ($product->getHotel() === $this) {
  570.                 $product->setHotel(null);
  571.             }
  572.         }
  573.         return $this;
  574.     }
  575.     public function getComplex(): ?Complex
  576.     {
  577.         return $this->complex;
  578.     }
  579.     public function setComplex(?Complex $complex): self
  580.     {
  581.         $this->complex $complex;
  582.         return $this;
  583.     }
  584.     /**
  585.      * @return Collection|User[]
  586.      */
  587.     public function getAssignedUsers(): Collection
  588.     {
  589.         return $this->assignedUsers;
  590.     }
  591.     public function addAssignedUser(User $user): self
  592.     {
  593.         if (!$this->assignedUsers->contains($user)) {
  594.             $this->assignedUsers[] = $user;
  595.         }
  596.         return $this;
  597.     }
  598.     public function removeAssignedUser(User $user): self
  599.     {
  600.         $this->assignedUsers->removeElement($user);
  601.         return $this;
  602.     }
  603.     public function getBlameableUser(): ?User
  604.     {
  605.         return $this->blameableUser;
  606.     }
  607.     public function setBlameableUser(User $blameableUser): self
  608.     {
  609.         $this->blameableUser $blameableUser;
  610.         return $this;
  611.     }
  612.     /**
  613.      * @return Collection|Media[]
  614.      */
  615.     public function getMedias(): Collection
  616.     {
  617.         return $this->medias;
  618.     }
  619.     public function addMedia(Media $media): self
  620.     {
  621.         if (!$this->medias->contains($media)) {
  622.             $this->medias[] = $media;
  623.         }
  624.         return $this;
  625.     }
  626.     public function removeMedia(Media $media): self
  627.     {
  628.         $this->medias->removeElement($media);
  629.         return $this;
  630.     }
  631.     /**
  632.      * @return Collection|Group[]
  633.      */
  634.     public function getGroups(): Collection
  635.     {
  636.         return $this->groups;
  637.     }
  638.     public function addGroup(Group $group): self
  639.     {
  640.         if (!$this->groups->contains($group)) {
  641.             $this->groups[] = $group;
  642.             $group->setHotel($this);
  643.         }
  644.         return $this;
  645.     }
  646.     public function removeGroup(Group $group): self
  647.     {
  648.         if ($this->groups->removeElement($group)) {
  649.             // set the owning side to null (unless already changed)
  650.             if ($group->getHotel() === $this) {
  651.                 $group->setHotel(null);
  652.             }
  653.         }
  654.         return $this;
  655.     }
  656.     public function getSubdomain(): ?string
  657.     {
  658.         return $this->subdomain;
  659.     }
  660.     public function setSubdomain(string $subdomain): self
  661.     {
  662.         $this->subdomain $subdomain;
  663.         return $this;
  664.     }
  665.     public function getPmsConnection(): ?string
  666.     {
  667.         return $this->pmsConnection;
  668.     }
  669.     public function setPmsConnection(?string $pmsConnection): self
  670.     {
  671.         $this->pmsConnection $pmsConnection;
  672.         return $this;
  673.     }
  674.     public function getPmsForbiddenEmailDomains(): ?string
  675.     {
  676.         return $this->pmsForbiddenEmailDomains;
  677.     }
  678.     public function setPmsForbiddenEmailDomains(?string $pmsForbiddenEmailDomains): self
  679.     {
  680.         $this->pmsForbiddenEmailDomains $pmsForbiddenEmailDomains;
  681.         return $this;
  682.     }
  683.     public function isEmailForbidden(?string $email): bool
  684.     {
  685.         if (empty($email)) {
  686.             return false;
  687.         }
  688.         $domains array_map('trim'explode(','$this->getPmsForbiddenEmailDomains()));
  689.         $domain substr(strrchr($email"@"), 1);
  690.         return in_array($domain$domainstrue);
  691.     }
  692.     /**
  693.      * @return Collection|Order[]
  694.      */
  695.     public function getOrders(): Collection
  696.     {
  697.         return $this->orders;
  698.     }
  699.     public function addOrder(Order $order): self
  700.     {
  701.         if (!$this->orders->contains($order)) {
  702.             $this->orders[] = $order;
  703.             $order->setHotel($this);
  704.         }
  705.         return $this;
  706.     }
  707.     public function removeOrder(Order $order): self
  708.     {
  709.         if ($this->orders->removeElement($order)) {
  710.             // set the owning side to null (unless already changed)
  711.             if ($order->getHotel() === $this) {
  712.                 $order->setHotel(null);
  713.             }
  714.         }
  715.         return $this;
  716.     }
  717.     /**
  718.      * @return Collection|Invoice[]
  719.      */
  720.     public function getInvoices(): Collection
  721.     {
  722.         return $this->invoices;
  723.     }
  724.     public function addInvoice(Invoice $invoice): self
  725.     {
  726.         if (!$this->invoices->contains($invoice)) {
  727.             $this->invoices[] = $invoice;
  728.             $invoice->setHotel($this);
  729.         }
  730.         return $this;
  731.     }
  732.     public function removeInvoice(Invoice $invoice): self
  733.     {
  734.         if ($this->invoices->removeElement($invoice)) {
  735.             // set the owning side to null (unless already changed)
  736.             if ($invoice->getHotel() === $this) {
  737.                 $invoice->setHotel(null);
  738.             }
  739.         }
  740.         return $this;
  741.     }
  742.     public function getAddress1(): ?string
  743.     {
  744.         return $this->address1;
  745.     }
  746.     public function setAddress1(?string $address1): self
  747.     {
  748.         $this->address1 $address1;
  749.         return $this;
  750.     }
  751.     public function getAddress2(): ?string
  752.     {
  753.         return $this->address2;
  754.     }
  755.     public function setAddress2(?string $address2): self
  756.     {
  757.         $this->address2 $address2;
  758.         return $this;
  759.     }
  760.     public function getPostalCode(): ?string
  761.     {
  762.         return $this->postalCode;
  763.     }
  764.     public function setPostalCode(?string $postalCode): self
  765.     {
  766.         $this->postalCode $postalCode;
  767.         return $this;
  768.     }
  769.     public function getCity(): ?string
  770.     {
  771.         return $this->city;
  772.     }
  773.     public function setCity(?string $city): self
  774.     {
  775.         $this->city $city;
  776.         return $this;
  777.     }
  778.     public function getState(): ?string
  779.     {
  780.         return $this->state;
  781.     }
  782.     public function setState(?string $state): self
  783.     {
  784.         $this->state $state;
  785.         return $this;
  786.     }
  787.     public function getCountry(): ?string
  788.     {
  789.         return $this->country;
  790.     }
  791.     public function setCountry(?string $country): self
  792.     {
  793.         $this->country $country;
  794.         return $this;
  795.     }
  796.     public function getTin(): ?string
  797.     {
  798.         return $this->tin;
  799.     }
  800.     public function setTin(?string $tin): self
  801.     {
  802.         $this->tin $tin;
  803.         return $this;
  804.     }
  805.     public function getFiscalName(): ?string
  806.     {
  807.         return $this->fiscalName;
  808.     }
  809.     public function setFiscalName(?string $fiscalName): self
  810.     {
  811.         $this->fiscalName $fiscalName;
  812.         return $this;
  813.     }
  814.     public function getInvoiceSerie(): ?string
  815.     {
  816.         return $this->invoiceSerie;
  817.     }
  818.     public function setInvoiceSerie(?string $invoiceSerie): self
  819.     {
  820.         $this->invoiceSerie $invoiceSerie;
  821.         return $this;
  822.     }
  823.     /**
  824.      * @return Collection|Page[]
  825.      */
  826.     public function getPages(): Collection
  827.     {
  828.         return $this->pages;
  829.     }
  830.     public function addPage(Page $page): self
  831.     {
  832.         if (!$this->pages->contains($page)) {
  833.             $this->pages[] = $page;
  834.             $page->setHotel($this);
  835.         }
  836.         return $this;
  837.     }
  838.     public function removePage(Page $page): self
  839.     {
  840.         if ($this->pages->removeElement($page)) {
  841.             // set the owning side to null (unless already changed)
  842.             if ($page->getHotel() === $this) {
  843.                 $page->setHotel(null);
  844.             }
  845.         }
  846.         return $this;
  847.     }
  848.     public function getOrderEmailsTo(): ?string
  849.     {
  850.         return $this->orderEmailsTo;
  851.     }
  852.     public function setOrderEmailTo(?string $orderEmailsTo): self
  853.     {
  854.         $this->orderEmailsTo $orderEmailsTo;
  855.         return $this;
  856.     }
  857.     public function getReplyToEmail(): ?string
  858.     {
  859.         return $this->replyToEmail;
  860.     }
  861.     public function setReplyToEmail(?string $replyToEmail): self
  862.     {
  863.         $this->replyToEmail $replyToEmail;
  864.         return $this;
  865.     }
  866.     public function getCountInfantsForRestaurantReserves(): ?bool
  867.     {
  868.         return $this->countInfantsForRestaurantReserves;
  869.     }
  870.     public function setCountInfantsForRestaurantReserves(bool $countInfantsForRestaurantReserves): self
  871.     {
  872.         $this->countInfantsForRestaurantReserves $countInfantsForRestaurantReserves;
  873.         return $this;
  874.     }
  875.     public function getErrorsMuted(): ?bool
  876.     {
  877.         return $this->errorsMuted;
  878.     }
  879.     public function setErrorsMuted(bool $errorsMuted): self
  880.     {
  881.         $this->errorsMuted $errorsMuted;
  882.         return $this;
  883.     }
  884.     public function hasErrorsMuted(): ?bool
  885.     {
  886.         return $this->getErrorsMuted();
  887.     }
  888.     public function getLogoMedia(): ?Media
  889.     {
  890.         return $this->getMediaByCategory(Media::CATEGORY_LOGO);
  891.     }
  892.     public function getBackgroundMedia(): ?Media
  893.     {
  894.         return $this->getMediaByCategory(Media::CATEGORY_IMAGE);
  895.     }
  896.     public function getMediaByCategory(string $category): ?Media
  897.     {
  898.         foreach ($this->getMedias() as $media) {
  899.             if ($media->getCategory() === $category) {
  900.                 return $media;
  901.             }
  902.         }
  903.         return null;
  904.     }
  905.     public function getStripePublishableKey(): ?string
  906.     {
  907.         return $this->stripePublishableKey;
  908.     }
  909.     public function setStripePublishableKey(?string $stripePublishableKey): self
  910.     {
  911.         $this->stripePublishableKey $stripePublishableKey;
  912.         return $this;
  913.     }
  914.     public function getStripeSecretKey(): ?string
  915.     {
  916.         return $this->stripeSecretKey;
  917.     }
  918.     public function setStripeSecretKey(?string $stripeSecretKey): self
  919.     {
  920.         $this->stripeSecretKey $stripeSecretKey;
  921.         return $this;
  922.     }
  923.     public function isStripeConfigured(): bool
  924.     {
  925.         return !is_null($this->getStripeSecretKey()) && !is_null($this->getStripePublishableKey());
  926.     }
  927.     public function getGoogleTagStreamId(): ?string
  928.     {
  929.         return $this->googleTagStreamId;
  930.     }
  931.     public function setGoogleTagStreamId(?string $googleTagStreamId): self
  932.     {
  933.         $this->googleTagStreamId $googleTagStreamId;
  934.         return $this;
  935.     }
  936.     public function getGoogleTagMeasurementId(): ?string
  937.     {
  938.         return $this->googleTagMeasurementId;
  939.     }
  940.     public function setGoogleTagMeasurementId(?string $googleTagMeasurementId): self
  941.     {
  942.         $this->googleTagMeasurementId $googleTagMeasurementId;
  943.         return $this;
  944.     }
  945.     public function isGoogleTagConfigured(): bool
  946.     {
  947.         return !is_null($this->getGoogleTagStreamId()) && !is_null($this->getGoogleTagMeasurementId());
  948.     }
  949.     public function getRestaurantReserveHomePosition(): ?int
  950.     {
  951.         return $this->restaurantReserveHomePosition;
  952.     }
  953.     public function setRestaurantReserveHomePosition(?int $restaurantReserveHomePosition): self
  954.     {
  955.         $this->restaurantReserveHomePosition $restaurantReserveHomePosition;
  956.         return $this;
  957.     }
  958.     public function getCreateTicketHomePosition(): ?int
  959.     {
  960.         return $this->createTicketHomePosition;
  961.     }
  962.     public function setCreateTicketHomePosition(?int $createTicketHomePosition): self
  963.     {
  964.         $this->createTicketHomePosition $createTicketHomePosition;
  965.         return $this;
  966.     }
  967.     public function setRestaurantReserveHomeImageFile(?File $restaurantReserveHomeImage null)
  968.     {
  969.         $this->restaurantReserveHomeImageFile $restaurantReserveHomeImage;
  970.         if (null !== $restaurantReserveHomeImage) {
  971.             $this->updatedAt = new \DateTime('now');
  972.         }
  973.     }
  974.     public function getRestaurantReserveHomeImageFile()
  975.     {
  976.         return $this->restaurantReserveHomeImageFile;
  977.     }
  978.     public function setRestaurantReserveHomeImage($restaurantReserveHomeImage)
  979.     {
  980.         $this->restaurantReserveHomeImage $restaurantReserveHomeImage;
  981.     }
  982.     public function getRestaurantReserveHomeImage()
  983.     {
  984.         return $this->restaurantReserveHomeImage;
  985.     }
  986.     public function setCreateTicketHomeImageFile(?File $createTicketHomeImage null)
  987.     {
  988.         $this->createTicketHomeImageFile $createTicketHomeImage;
  989.         if (null !== $createTicketHomeImage) {
  990.             $this->updatedAt = new \DateTime('now');
  991.         }
  992.     }
  993.     public function getCreateTicketHomeImageFile()
  994.     {
  995.         return $this->createTicketHomeImageFile;
  996.     }
  997.     public function setCreateTicketHomeImage($createTicketHomeImage)
  998.     {
  999.         $this->createTicketHomeImage $createTicketHomeImage;
  1000.     }
  1001.     public function getCreateTicketHomeImage()
  1002.     {
  1003.         return $this->createTicketHomeImage;
  1004.     }
  1005.     public function getLastPmsUpdatedAt(): ?\DateTimeInterface
  1006.     {
  1007.         return $this->lastPmsUpdatedAt;
  1008.     }
  1009.     public function setLastPmsUpdatedAt(?\DateTimeInterface $lastPmsUpdatedAt): self
  1010.     {
  1011.         $this->lastPmsUpdatedAt $lastPmsUpdatedAt;
  1012.         return $this;
  1013.     }
  1014.     public function getTicketCallAssignedUser(): ?User
  1015.     {
  1016.         return $this->ticketCallAssignedUser;
  1017.     }
  1018.     public function setTicketCallAssignedUser(?User $ticketCallAssignedUser): self
  1019.     {
  1020.         $this->ticketCallAssignedUser $ticketCallAssignedUser;
  1021.         return $this;
  1022.     }
  1023.     /**
  1024.      * @return Collection<int, WiFiPremium>
  1025.      */
  1026.     public function getWiFiPremiums(): Collection
  1027.     {
  1028.         return $this->wiFiPremiums;
  1029.     }
  1030.     public function addWiFiPremium(WiFiPremium $wiFiPremium): self
  1031.     {
  1032.         if (!$this->wiFiPremiums->contains($wiFiPremium)) {
  1033.             $this->wiFiPremiums[] = $wiFiPremium;
  1034.             $wiFiPremium->setHotel($this);
  1035.         }
  1036.         return $this;
  1037.     }
  1038.     public function removeWiFiPremium(WiFiPremium $wiFiPremium): self
  1039.     {
  1040.         if ($this->wiFiPremiums->removeElement($wiFiPremium)) {
  1041.             // set the owning side to null (unless already changed)
  1042.             if ($wiFiPremium->getHotel() === $this) {
  1043.                 $wiFiPremium->setHotel(null);
  1044.             }
  1045.         }
  1046.         return $this;
  1047.     }
  1048.     public function isGreenApiActive(): ?bool
  1049.     {
  1050.         return $this->greenApiActive;
  1051.     }
  1052.     public function setGreenApiActive(bool $greenApiActive): self
  1053.     {
  1054.         $this->greenApiActive $greenApiActive;
  1055.         return $this;
  1056.     }
  1057.     public function getGreenApiId(): ?string
  1058.     {
  1059.         return $this->greenApiId;
  1060.     }
  1061.     public function setGreenApiId(?string $greenApiId): self
  1062.     {
  1063.         $this->greenApiId $greenApiId;
  1064.         return $this;
  1065.     }
  1066.     public function getGreenApiToken(): ?string
  1067.     {
  1068.         return $this->greenApiToken;
  1069.     }
  1070.     public function setGreenApiToken(?string $greenApiToken): self
  1071.     {
  1072.         $this->greenApiToken $greenApiToken;
  1073.         return $this;
  1074.     }
  1075. }