src/Entity/Institution.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Traits\Activeable;
  4. use App\Traits\Creatable;
  5. use App\Traits\Deleteable;
  6. use App\Traits\Updateable;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. use DateTime;
  12. use DateTimeInterface;
  13. /**
  14.  * @ORM\Table(name="`institution`")
  15.  * @ORM\Entity()
  16.  * @Gedmo\SoftDeleteable(fieldName="deletedAt")
  17.  */
  18. class Institution
  19. {
  20.     use CreatableUpdateableDeleteableActiveable;
  21.     /**
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private ?int $id null;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @ORM\Column(name="name", type="string")
  31.      */
  32.     private string $name;
  33.     /**
  34.      * @var ?string
  35.      *
  36.      * @ORM\Column(name="url", type="string", nullable=true)
  37.      */
  38.     private ?string $url null;
  39.     /**
  40.      * @var ?string
  41.      *
  42.      * @ORM\Column(name="phone", type="string", nullable=true)
  43.      */
  44.     private ?string $phone null;
  45.     /**
  46.      * @var boolean
  47.      *
  48.      * @ORM\Column(name="is_default", type="boolean")
  49.      */
  50.     private bool $isDefault;
  51.     /**
  52.      * @var ?string
  53.      *
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      */
  56.     private ?string $facebook null;
  57.     /**
  58.      * @var ?string
  59.      *
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private ?string $instagram null;
  63.     /**
  64.      * @var ?string
  65.      *
  66.      * @ORM\Column(type="string", length=255, nullable=true)
  67.      */
  68.     private ?string $facebookToken null;
  69.     /**
  70.      * @var ?string
  71.      *
  72.      * @ORM\Column(type="string", length=255, nullable=true)
  73.      */
  74.     private ?string $senderSms null;
  75.     /**
  76.      * @var ?string
  77.      *
  78.      * @ORM\Column(name="hash", type="string", nullable=true)
  79.      */
  80.     private ?string $hash null;
  81.     /**
  82.      * @var ?DateTime
  83.      *
  84.      * @ORM\Column(type="datetime", nullable=true)
  85.      */
  86.     private ?DateTime $qrCodeLastDownloadAt null;
  87.     /**
  88.      * @ORM\ManyToOne(targetEntity="App\Entity\Document", cascade={"persist"})
  89.      * @ORM\JoinColumn(name="document_id", referencedColumnName="id")
  90.      */
  91.     private ?Document $logo null;
  92.     /**
  93.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="institutions")
  94.      */
  95.     private ?User $user null;
  96.     /**
  97.      * @ORM\OneToOne(targetEntity="App\Entity\Address", cascade={"persist"})
  98.      */
  99.     private ?Address $address null;
  100.     /**
  101.      * @ORM\OneToOne(targetEntity="App\Entity\Document", cascade={"persist"})
  102.      */
  103.     private ?Document $qrCode null;
  104.     /**
  105.      * @ORM\OneToMany(targetEntity="App\Entity\DishCategory", mappedBy="institution", cascade={"remove", "persist"})
  106.      */
  107.     private Collection $dishCategories;
  108.     /**
  109.      * @ORM\OneToMany(targetEntity="App\Entity\WineCategory", mappedBy="institution", cascade={"remove", "persist"})
  110.      */
  111.     private Collection $wineCategories;
  112.     /**
  113.      * @ORM\OneToMany(targetEntity="App\Entity\BeerCategory", mappedBy="institution", cascade={"remove", "persist"})
  114.      */
  115.     private Collection $beerCategories;
  116.     /**
  117.      * @ORM\OneToMany(targetEntity="App\Entity\Dish", mappedBy="institution", cascade={"remove", "persist"})
  118.      * @ORM\OrderBy({"position" = "ASC"})
  119.      */
  120.     private Collection $dishes;
  121.     /**
  122.      * @ORM\OneToMany(targetEntity="App\Entity\Menu", mappedBy="institution", cascade={"remove", "persist"})
  123.      */
  124.     private Collection $menus;
  125.     /**
  126.      * @ORM\OneToMany(targetEntity="App\Entity\MenuCategory", mappedBy="institution", cascade={"remove", "persist"})
  127.      */
  128.     private Collection $menuCategories;
  129.     /**
  130.      * @ORM\OneToMany(targetEntity="App\Entity\Offer", mappedBy="institution", cascade={"remove", "persist"})
  131.      */
  132.     private Collection $offers;
  133.     /**
  134.      * @ORM\OneToMany(targetEntity="App\Entity\Wine", mappedBy="institution", cascade={"remove", "persist"})
  135.      * @ORM\OrderBy({"position" = "ASC"})
  136.      */
  137.     private Collection $wines;
  138.     /**
  139.      * @ORM\OneToMany(targetEntity="App\Entity\DrinkCategory", mappedBy="institution", cascade={"remove", "persist"})
  140.      */
  141.     private Collection $drinkCategories;
  142.     /**
  143.      * @ORM\OneToMany(targetEntity="App\Entity\Drink", mappedBy="institution", cascade={"remove", "persist"})
  144.      * @ORM\OrderBy({"position" = "ASC"})
  145.      */
  146.     private Collection $drinks;
  147.     /**
  148.      * @ORM\OneToMany(targetEntity="App\Entity\Beer", mappedBy="institution", cascade={"remove", "persist"})
  149.      * @ORM\OrderBy({"position" = "ASC"})
  150.      */
  151.     private Collection $beers;
  152.     /**
  153.      * @ORM\OneToMany(targetEntity="App\Entity\Capacity", mappedBy="institution", cascade={"remove", "persist"})
  154.      */
  155.     private Collection $capacities;
  156.     /**
  157.      * @ORM\OneToMany(targetEntity="App\Entity\Creation", mappedBy="institution", cascade={"remove", "persist"})
  158.      * @ORM\OrderBy({"updatedAt" = "DESC"})
  159.      */
  160.     private Collection $creations;
  161.     /**
  162.      * @ORM\OneToMany(targetEntity="App\Entity\CreationCategory", mappedBy="institution", cascade={"remove", "persist"})
  163.      */
  164.     private Collection $creationCategories;
  165.     /**
  166.      * @ORM\OneToMany(targetEntity="App\Entity\WinePairing", mappedBy="institution", cascade={"remove", "persist"})
  167.      */
  168.     private Collection $winePairings;
  169.     /**
  170.      * @ORM\OneToMany(targetEntity="App\Entity\BeerPairing", mappedBy="institution", cascade={"remove", "persist"})
  171.      */
  172.     private Collection $beerPairings;
  173.     /**
  174.      * @ORM\OneToMany(targetEntity="App\Entity\PdfmenuDocument", mappedBy="institution", cascade={"remove", "persist"})
  175.      * @ORM\OrderBy({"position" = "ASC"})
  176.      */
  177.     private Collection $pdfmenuDocuments;
  178.     /**
  179.      * @ORM\OneToOne(targetEntity="App\Entity\PdfmenuPersonalization", mappedBy="institution", cascade={"remove", "persist"})
  180.      */
  181.     private ?PdfmenuPersonalization $pdfmenuPersonalization null;
  182.     /**
  183.      * @ORM\OneToOne(targetEntity="App\Entity\InstitutionAppPersonalization", mappedBy="institution", cascade={"remove", "persist"})
  184.      */
  185.     private ?InstitutionAppPersonalization $institutionAppPersonalization null;
  186.     /**
  187.      * @var ?string
  188.      *
  189.      * @ORM\Column(type="text", nullable=true)
  190.      */
  191.     private ?string $description null;
  192.     /**
  193.      * @ORM\OneToMany(targetEntity="App\Entity\OpeningHour", mappedBy="institution", cascade={"remove", "persist"})
  194.      */
  195.     private Collection $openingHours;
  196.     /**
  197.      * @ORM\OneToMany(targetEntity="App\Entity\Grape", mappedBy="institution", cascade={"remove", "persist"})
  198.      */
  199.     private Collection $grapes;
  200.     /**
  201.      * @var bool
  202.      *
  203.      * @ORM\Column(type="boolean", nullable=true)
  204.      */
  205.     private ?bool $isPdfMenuActive null;
  206.     /**
  207.      * @ORM\OneToMany(targetEntity="App\Entity\InstitutionLocaleFront", mappedBy="institution", cascade={"remove", "persist"})
  208.      */
  209.     private Collection $institutionLocaleFronts;
  210.     /**
  211.      * @ORM\OneToMany(targetEntity="App\Entity\InstitutionReview", mappedBy="institution", cascade={"remove", "persist"})
  212.      * @ORM\OrderBy({"date" = "DESC"})
  213.      */
  214.     private Collection $institutionReviews;
  215.     /**
  216.      * @ORM\OneToOne(targetEntity="App\Entity\InstitutionReviewSummary", mappedBy="institution", cascade={"remove", "persist"})
  217.      */
  218.     private ?InstitutionReviewSummary $institutionReviewSummary null;
  219.     /**
  220.      * @ORM\OneToMany(targetEntity="App\Entity\Contest", mappedBy="institution", cascade={"remove", "persist"})
  221.      */
  222.     private Collection $contests;
  223.     /**
  224.      * @ORM\OneToMany(targetEntity="App\Entity\Analysis", mappedBy="institution", cascade={"remove", "persist"})
  225.      */
  226.     private Collection $analyses;
  227.     /**
  228.      * @ORM\OneToMany(targetEntity="App\Entity\Order", mappedBy="institution")
  229.      * @ORM\OrderBy({"createdAt" = "DESC"})
  230.      */
  231.     private Collection $orders;
  232.     /**
  233.      * @ORM\OneToMany(targetEntity="App\Entity\ProductCategoryPosition", mappedBy="institution", cascade={"remove", "persist"})
  234.      */
  235.     private Collection $productCategoryPositions;
  236.     /**
  237.      * @ORM\ManyToMany(targetEntity="App\Entity\Document", cascade={"persist"})
  238.      * @ORM\JoinTable(name="institution_gallery",
  239.      *      joinColumns={@ORM\JoinColumn(name="institution_id", referencedColumnName="id")},
  240.      *      inverseJoinColumns={@ORM\JoinColumn(name="document_id", referencedColumnName="id")}
  241.      *      )
  242.      */
  243.     private Collection $gallery;
  244.     public function __construct()
  245.     {
  246.         $this->isDefault false;
  247.         $this->dishCategories = new ArrayCollection();
  248.         $this->wineCategories = new ArrayCollection();
  249.         $this->beerCategories = new ArrayCollection();
  250.         $this->menuCategories = new ArrayCollection();
  251.         $this->dishes = new ArrayCollection();
  252.         $this->menus = new ArrayCollection();
  253.         $this->offers = new ArrayCollection();
  254.         $this->wines = new ArrayCollection();
  255.         $this->beers = new ArrayCollection();
  256.         $this->creations = new ArrayCollection();
  257.         $this->creationCategories = new ArrayCollection();
  258.         $this->drinks = new ArrayCollection();
  259.         $this->drinkCategories = new ArrayCollection();
  260.         $this->capacities = new ArrayCollection();
  261.         $this->winePairings = new ArrayCollection();
  262.         $this->beerPairings = new ArrayCollection();
  263.         $this->pdfmenuDocuments = new ArrayCollection();
  264.         $this->openingHours = new ArrayCollection();
  265.         $this->grapes = new ArrayCollection();
  266.         $this->isPdfMenuActive true;
  267.         $this->institutionLocaleFronts = new ArrayCollection();
  268.         $this->institutionReviews = new ArrayCollection();
  269.         $this->contests = new ArrayCollection();
  270.         $this->analyses = new ArrayCollection();
  271.         $this->orders = new ArrayCollection();
  272.         $this->productCategoryPositions = new ArrayCollection();
  273.         $this->gallery = new ArrayCollection();
  274.     }
  275.     public function getId(): ?int
  276.     {
  277.         return $this->id;
  278.     }
  279.     public function getName(): ?string
  280.     {
  281.         return $this->name;
  282.     }
  283.     public function setName(string $name): self
  284.     {
  285.         $this->name $name;
  286.         return $this;
  287.     }
  288.     public function getUrl(): ?string
  289.     {
  290.         return $this->url;
  291.     }
  292.     public function setUrl(?string $url): self
  293.     {
  294.         $this->url $url;
  295.         return $this;
  296.     }
  297.     public function getPhone(): ?string
  298.     {
  299.         return $this->phone;
  300.     }
  301.     public function setPhone(?string $phone): self
  302.     {
  303.         $this->phone $phone;
  304.         return $this;
  305.     }
  306.     public function isDefault(): ?bool
  307.     {
  308.         return $this->isDefault;
  309.     }
  310.     public function setIsDefault(bool $isDefault): self
  311.     {
  312.         $this->isDefault $isDefault;
  313.         return $this;
  314.     }
  315.     public function getFacebook(): ?string
  316.     {
  317.         return $this->facebook;
  318.     }
  319.     public function setFacebook(?string $facebook): self
  320.     {
  321.         $this->facebook $facebook;
  322.         return $this;
  323.     }
  324.     public function getInstagram(): ?string
  325.     {
  326.         return $this->instagram;
  327.     }
  328.     public function setInstagram(?string $instagram): self
  329.     {
  330.         $this->instagram $instagram;
  331.         return $this;
  332.     }
  333.     public function getFacebookToken(): ?string
  334.     {
  335.         return $this->facebookToken;
  336.     }
  337.     public function setFacebookToken(?string $facebookToken): self
  338.     {
  339.         $this->facebookToken $facebookToken;
  340.         return $this;
  341.     }
  342.     public function getSenderSms(): ?string
  343.     {
  344.         return $this->senderSms;
  345.     }
  346.     public function setSenderSms(?string $senderSms): self
  347.     {
  348.         $this->senderSms $senderSms;
  349.         return $this;
  350.     }
  351.     public function getHash(): ?string
  352.     {
  353.         return $this->hash;
  354.     }
  355.     public function setHash(?string $hash): self
  356.     {
  357.         $this->hash $hash;
  358.         return $this;
  359.     }
  360.     public function getLogo(): ?Document
  361.     {
  362.         return $this->logo;
  363.     }
  364.     public function setLogo(?Document $logo): self
  365.     {
  366.         $this->logo $logo;
  367.         return $this;
  368.     }
  369.     public function getUser(): ?User
  370.     {
  371.         return $this->user;
  372.     }
  373.     public function setUser(?User $user): self
  374.     {
  375.         $this->user $user;
  376.         return $this;
  377.     }
  378.     public function getAddress(): ?Address
  379.     {
  380.         return $this->address;
  381.     }
  382.     public function setAddress(?Address $address): self
  383.     {
  384.         $this->address $address;
  385.         return $this;
  386.     }
  387.     public function getQrCode(): ?Document
  388.     {
  389.         return $this->qrCode;
  390.     }
  391.     public function setQrCode(?Document $qrCode): self
  392.     {
  393.         $this->qrCode $qrCode;
  394.         return $this;
  395.     }
  396.     /**
  397.      * @return Collection|DishCategory[]
  398.      */
  399.     public function getDishCategories(): array|Collection
  400.     {
  401.         return $this->dishCategories;
  402.     }
  403.     public function addDishCategory(DishCategory $dishCategory): self
  404.     {
  405.         if (!$this->dishCategories->contains($dishCategory)) {
  406.             $this->dishCategories[] = $dishCategory;
  407.             $dishCategory->setInstitution($this);
  408.         }
  409.         return $this;
  410.     }
  411.     public function removeDishCategory(DishCategory $dishCategory): self
  412.     {
  413.         if ($this->dishCategories->contains($dishCategory)) {
  414.             $this->dishCategories->removeElement($dishCategory);
  415.             // set the owning side to null (unless already changed)
  416.             if ($dishCategory->getInstitution() === $this) {
  417.                 $dishCategory->setInstitution(null);
  418.             }
  419.         }
  420.         return $this;
  421.     }
  422.     /**
  423.      * @return Collection|WineCategory[]
  424.      */
  425.     public function getWineCategories(): array|Collection
  426.     {
  427.         return $this->wineCategories;
  428.     }
  429.     public function addWineCategory(WineCategory $wineCategory): self
  430.     {
  431.         if (!$this->wineCategories->contains($wineCategory)) {
  432.             $this->wineCategories[] = $wineCategory;
  433.             $wineCategory->setInstitution($this);
  434.         }
  435.         return $this;
  436.     }
  437.     public function removeWineCategory(WineCategory $wineCategory): self
  438.     {
  439.         if ($this->wineCategories->removeElement($wineCategory)) {
  440.             // set the owning side to null (unless already changed)
  441.             if ($wineCategory->getInstitution() === $this) {
  442.                 $wineCategory->setInstitution(null);
  443.             }
  444.         }
  445.         return $this;
  446.     }
  447.     /**
  448.      * @return Collection|BeerCategory[]
  449.      */
  450.     public function getBeerCategories(): array|Collection
  451.     {
  452.         return $this->beerCategories;
  453.     }
  454.     public function addBeerCategory(BeerCategory $beerCategory): self
  455.     {
  456.         if (!$this->beerCategories->contains($beerCategory)) {
  457.             $this->beerCategories[] = $beerCategory;
  458.             $beerCategory->setInstitution($this);
  459.         }
  460.         return $this;
  461.     }
  462.     public function removeBeerCategory(BeerCategory $beerCategory): self
  463.     {
  464.         if ($this->beerCategories->removeElement($beerCategory)) {
  465.             // set the owning side to null (unless already changed)
  466.             if ($beerCategory->getInstitution() === $this) {
  467.                 $beerCategory->setInstitution(null);
  468.             }
  469.         }
  470.         return $this;
  471.     }
  472.     /**
  473.      * @return Collection|Dish[]
  474.      */
  475.     public function getDishes(): array|Collection
  476.     {
  477.         return $this->dishes;
  478.     }
  479.     public function addDish(Dish $dish): self
  480.     {
  481.         if (!$this->dishes->contains($dish)) {
  482.             $this->dishes[] = $dish;
  483.             $dish->setInstitution($this);
  484.         }
  485.         return $this;
  486.     }
  487.     public function removeDish(Dish $dish): self
  488.     {
  489.         if ($this->dishes->contains($dish)) {
  490.             $this->dishes->removeElement($dish);
  491.             // set the owning side to null (unless already changed)
  492.             if ($dish->getInstitution() === $this) {
  493.                 $dish->setInstitution(null);
  494.             }
  495.         }
  496.         return $this;
  497.     }
  498.     /**
  499.      * @return Collection|Menu[]
  500.      */
  501.     public function getMenus(): array|Collection
  502.     {
  503.         return $this->menus;
  504.     }
  505.     public function addMenu(Menu $menu): self
  506.     {
  507.         if (!$this->menus->contains($menu)) {
  508.             $this->menus[] = $menu;
  509.             $menu->setInstitution($this);
  510.         }
  511.         return $this;
  512.     }
  513.     public function removeMenu(Menu $menu): self
  514.     {
  515.         if ($this->menus->contains($menu)) {
  516.             $this->menus->removeElement($menu);
  517.             // set the owning side to null (unless already changed)
  518.             if ($menu->getInstitution() === $this) {
  519.                 $menu->setInstitution(null);
  520.             }
  521.         }
  522.         return $this;
  523.     }
  524.     /**
  525.      * @return Collection|MenuCategory[]
  526.      */
  527.     public function getMenuCategories(): array|Collection
  528.     {
  529.         return $this->menuCategories;
  530.     }
  531.     public function addMenuCategory(MenuCategory $menuCategory): self
  532.     {
  533.         if (!$this->menuCategories->contains($menuCategory)) {
  534.             $this->menuCategories[] = $menuCategory;
  535.             $menuCategory->setInstitution($this);
  536.         }
  537.         return $this;
  538.     }
  539.     public function removeMenuCategory(MenuCategory $menuCategory): self
  540.     {
  541.         if ($this->menuCategories->removeElement($menuCategory)) {
  542.             // set the owning side to null (unless already changed)
  543.             if ($menuCategory->getInstitution() === $this) {
  544.                 $menuCategory->setInstitution(null);
  545.             }
  546.         }
  547.         return $this;
  548.     }
  549.     /**
  550.      * @return Collection|Offer[]
  551.      */
  552.     public function getOffers(): Collection|array
  553.     {
  554.         return $this->offers;
  555.     }
  556.     public function addOffer(Offer $offer): self
  557.     {
  558.         if (!$this->offers->contains($offer)) {
  559.             $this->offers[] = $offer;
  560.             $offer->setInstitution($this);
  561.         }
  562.         return $this;
  563.     }
  564.     public function removeOffer(Offer $offer): self
  565.     {
  566.         if ($this->offers->removeElement($offer)) {
  567.             // set the owning side to null (unless already changed)
  568.             if ($offer->getInstitution() === $this) {
  569.                 $offer->setInstitution(null);
  570.             }
  571.         }
  572.         return $this;
  573.     }
  574.     /**
  575.      * @return Collection|Wine[]
  576.      */
  577.     public function getWines(): array|Collection
  578.     {
  579.         return $this->wines;
  580.     }
  581.     public function addWine(Wine $wine): self
  582.     {
  583.         if (!$this->wines->contains($wine)) {
  584.             $this->wines[] = $wine;
  585.             $wine->setInstitution($this);
  586.         }
  587.         return $this;
  588.     }
  589.     public function removeWine(Wine $wine): self
  590.     {
  591.         if ($this->wines->contains($wine)) {
  592.             $this->wines->removeElement($wine);
  593.             // set the owning side to null (unless already changed)
  594.             if ($wine->getInstitution() === $this) {
  595.                 $wine->setInstitution(null);
  596.             }
  597.         }
  598.         return $this;
  599.     }
  600.     /**
  601.      * @return Collection|DrinkCategory[]
  602.      */
  603.     public function getDrinkCategories(): Collection|array
  604.     {
  605.         return $this->drinkCategories;
  606.     }
  607.     public function addDrinkCategory(DrinkCategory $drinkCategory): self
  608.     {
  609.         if (!$this->drinkCategories->contains($drinkCategory)) {
  610.             $this->drinkCategories[] = $drinkCategory;
  611.             $drinkCategory->setInstitution($this);
  612.         }
  613.         return $this;
  614.     }
  615.     public function removeDrinkCategory(DrinkCategory $drinkCategory): self
  616.     {
  617.         if ($this->drinkCategories->contains($drinkCategory)) {
  618.             $this->drinkCategories->removeElement($drinkCategory);
  619.             // set the owning side to null (unless already changed)
  620.             if ($drinkCategory->getInstitution() === $this) {
  621.                 $drinkCategory->setInstitution(null);
  622.             }
  623.         }
  624.         return $this;
  625.     }
  626.     /**
  627.      * @return Collection|Drink[]
  628.      */
  629.     public function getDrinks(): Collection|array
  630.     {
  631.         return $this->drinks;
  632.     }
  633.     public function addDrink(Drink $drink): self
  634.     {
  635.         if (!$this->drinks->contains($drink)) {
  636.             $this->drinks[] = $drink;
  637.             $drink->setInstitution($this);
  638.         }
  639.         return $this;
  640.     }
  641.     public function removeDrink(Drink $drink): self
  642.     {
  643.         if ($this->drinks->contains($drink)) {
  644.             $this->drinks->removeElement($drink);
  645.             // set the owning side to null (unless already changed)
  646.             if ($drink->getInstitution() === $this) {
  647.                 $drink->setInstitution(null);
  648.             }
  649.         }
  650.         return $this;
  651.     }
  652.     /**
  653.      * @return Collection|Beer[]
  654.      */
  655.     public function getBeers(): array|Collection
  656.     {
  657.         return $this->beers;
  658.     }
  659.     public function addBeer(Beer $beer): self
  660.     {
  661.         if (!$this->beers->contains($beer)) {
  662.             $this->beers[] = $beer;
  663.             $beer->setInstitution($this);
  664.         }
  665.         return $this;
  666.     }
  667.     public function removeBeer(Beer $beer): self
  668.     {
  669.         if ($this->beers->contains($beer)) {
  670.             $this->beers->removeElement($beer);
  671.             // set the owning side to null (unless already changed)
  672.             if ($beer->getInstitution() === $this) {
  673.                 $beer->setInstitution(null);
  674.             }
  675.         }
  676.         return $this;
  677.     }
  678.     /**
  679.      * @return Collection|Capacity[]
  680.      */
  681.     public function getCapacities(): Collection|array
  682.     {
  683.         return $this->capacities;
  684.     }
  685.     public function addCapacity(Capacity $capacity): self
  686.     {
  687.         if (!$this->capacities->contains($capacity)) {
  688.             $this->capacities[] = $capacity;
  689.             $capacity->setInstitution($this);
  690.         }
  691.         return $this;
  692.     }
  693.     public function removeCapacity(Capacity $capacity): self
  694.     {
  695.         if ($this->capacities->contains($capacity)) {
  696.             $this->capacities->removeElement($capacity);
  697.             // set the owning side to null (unless already changed)
  698.             if ($capacity->getInstitution() === $this) {
  699.                 $capacity->setInstitution(null);
  700.             }
  701.         }
  702.         return $this;
  703.     }
  704.     /**
  705.      * @return Collection|Creation[]
  706.      */
  707.     public function getCreations(): Collection|array
  708.     {
  709.         return $this->creations;
  710.     }
  711.     public function addCreation(Creation $creation): self
  712.     {
  713.         if (!$this->creations->contains($creation)) {
  714.             $this->creations[] = $creation;
  715.             $creation->setInstitution($this);
  716.         }
  717.         return $this;
  718.     }
  719.     public function removeCreation(Creation $creation): self
  720.     {
  721.         if ($this->creations->contains($creation)) {
  722.             $this->creations->removeElement($creation);
  723.             // set the owning side to null (unless already changed)
  724.             if ($creation->getInstitution() === $this) {
  725.                 $creation->setInstitution(null);
  726.             }
  727.         }
  728.         return $this;
  729.     }
  730.     /**
  731.      * @return Collection|CreationCategory[]
  732.      */
  733.     public function getCreationCategories(): Collection|array
  734.     {
  735.         return $this->creationCategories;
  736.     }
  737.     public function addCreationCategory(CreationCategory $creationCategory): self
  738.     {
  739.         if (!$this->creationCategories->contains($creationCategory)) {
  740.             $this->creationCategories[] = $creationCategory;
  741.             $creationCategory->setInstitution($this);
  742.         }
  743.         return $this;
  744.     }
  745.     public function removeCreationCategory(CreationCategory $creationCategory): self
  746.     {
  747.         if ($this->creationCategories->contains($creationCategory)) {
  748.             $this->creationCategories->removeElement($creationCategory);
  749.             // set the owning side to null (unless already changed)
  750.             if ($creationCategory->getInstitution() === $this) {
  751.                 $creationCategory->setInstitution(null);
  752.             }
  753.         }
  754.         return $this;
  755.     }
  756.     public function getIsDefault(): ?bool
  757.     {
  758.         return $this->isDefault;
  759.     }
  760.     /**
  761.      * @return Collection|WinePairing[]
  762.      */
  763.     public function getWinePairings(): array|Collection
  764.     {
  765.         return $this->winePairings;
  766.     }
  767.     public function addWinePairing(WinePairing $winePairing): self
  768.     {
  769.         if (!$this->winePairings->contains($winePairing)) {
  770.             $this->winePairings[] = $winePairing;
  771.             $winePairing->setInstitution($this);
  772.         }
  773.         return $this;
  774.     }
  775.     public function removeWinePairing(WinePairing $winePairing): self
  776.     {
  777.         if ($this->winePairings->contains($winePairing)) {
  778.             $this->winePairings->removeElement($winePairing);
  779.             // set the owning side to null (unless already changed)
  780.             if ($winePairing->getInstitution() === $this) {
  781.                 $winePairing->setInstitution(null);
  782.             }
  783.         }
  784.         return $this;
  785.     }
  786.     /**
  787.      * @return Collection|BeerPairing[]
  788.      */
  789.     public function getBeerPairings(): array|Collection
  790.     {
  791.         return $this->beerPairings;
  792.     }
  793.     public function addBeerPairing(BeerPairing $beerPairing): self
  794.     {
  795.         if (!$this->beerPairings->contains($beerPairing)) {
  796.             $this->beerPairings[] = $beerPairing;
  797.             $beerPairing->setInstitution($this);
  798.         }
  799.         return $this;
  800.     }
  801.     public function removeBeerPairing(BeerPairing $beerPairing): self
  802.     {
  803.         if ($this->beerPairings->contains($beerPairing)) {
  804.             $this->beerPairings->removeElement($beerPairing);
  805.             // set the owning side to null (unless already changed)
  806.             if ($beerPairing->getInstitution() === $this) {
  807.                 $beerPairing->setInstitution(null);
  808.             }
  809.         }
  810.         return $this;
  811.     }
  812.     /**
  813.      * @return Collection|PdfmenuDocument[]
  814.      */
  815.     public function getPdfmenuDocuments(): array|Collection
  816.     {
  817.         return $this->pdfmenuDocuments;
  818.     }
  819.     public function addPdfmenuDocument(PdfmenuDocument $pdfmenuDocument): self
  820.     {
  821.         if (!$this->pdfmenuDocuments->contains($pdfmenuDocument)) {
  822.             $this->pdfmenuDocuments[] = $pdfmenuDocument;
  823.             $pdfmenuDocument->setInstitution($this);
  824.         }
  825.         return $this;
  826.     }
  827.     public function removePdfmenuDocument(PdfmenuDocument $pdfmenuDocument): self
  828.     {
  829.         if ($this->pdfmenuDocuments->contains($pdfmenuDocument)) {
  830.             $this->pdfmenuDocuments->removeElement($pdfmenuDocument);
  831.             // set the owning side to null (unless already changed)
  832.             if ($pdfmenuDocument->getInstitution() === $this) {
  833.                 $pdfmenuDocument->setInstitution(null);
  834.             }
  835.         }
  836.         return $this;
  837.     }
  838.     public function getPdfmenuPersonalization(): ?PdfmenuPersonalization
  839.     {
  840.         return $this->pdfmenuPersonalization;
  841.     }
  842.     public function setPdfmenuPersonalization(?PdfmenuPersonalization $pdfmenuPersonalization): self
  843.     {
  844.         $this->pdfmenuPersonalization $pdfmenuPersonalization;
  845.         // set (or unset) the owning side of the relation if necessary
  846.         $newInstitution null === $pdfmenuPersonalization null $this;
  847.         if ($pdfmenuPersonalization->getInstitution() !== $newInstitution) {
  848.             $pdfmenuPersonalization->setInstitution($newInstitution);
  849.         }
  850.         return $this;
  851.     }
  852.     public function getInstitutionAppPersonalization(): ?InstitutionAppPersonalization
  853.     {
  854.         return $this->institutionAppPersonalization;
  855.     }
  856.     public function setInstitutionAppPersonalization(?InstitutionAppPersonalization $institutionAppPersonalization): self
  857.     {
  858.         $this->institutionAppPersonalization $institutionAppPersonalization;
  859.         // set (or unset) the owning side of the relation if necessary
  860.         $newInstitution null === $institutionAppPersonalization null $this;
  861.         if ($institutionAppPersonalization->getInstitution() !== $newInstitution) {
  862.             $institutionAppPersonalization->setInstitution($newInstitution);
  863.         }
  864.         return $this;
  865.     }
  866.     public function getDescription(): ?string
  867.     {
  868.         return $this->description;
  869.     }
  870.     public function setDescription(?string $description): self
  871.     {
  872.         $this->description $description;
  873.         return $this;
  874.     }
  875.     /**
  876.      * @return Collection|OpeningHour[]
  877.      */
  878.     public function getOpeningHours(): array|Collection
  879.     {
  880.         return $this->openingHours;
  881.     }
  882.     public function addOpeningHour(OpeningHour $openingHour): self
  883.     {
  884.         if (!$this->openingHours->contains($openingHour)) {
  885.             $this->openingHours[] = $openingHour;
  886.             $openingHour->setInstitution($this);
  887.         }
  888.         return $this;
  889.     }
  890.     public function removeOpeningHour(OpeningHour $openingHour): self
  891.     {
  892.         if ($this->openingHours->removeElement($openingHour)) {
  893.             // set the owning side to null (unless already changed)
  894.             if ($openingHour->getInstitution() === $this) {
  895.                 $openingHour->setInstitution(null);
  896.             }
  897.         }
  898.         return $this;
  899.     }
  900.     /**
  901.      * @return Collection|Grape[]
  902.      */
  903.     public function getGrapes(): Collection|array
  904.     {
  905.         return $this->grapes;
  906.     }
  907.     public function addGrape(Grape $grape): self
  908.     {
  909.         if (!$this->grapes->contains($grape)) {
  910.             $this->grapes[] = $grape;
  911.             $grape->setInstitution($this);
  912.         }
  913.         return $this;
  914.     }
  915.     public function removeGrape(Grape $grape): self
  916.     {
  917.         if ($this->grapes->contains($grape)) {
  918.             $this->grapes->removeElement($grape);
  919.             // set the owning side to null (unless already changed)
  920.             if ($grape->getInstitution() === $this) {
  921.                 $grape->setInstitution(null);
  922.             }
  923.         }
  924.         return $this;
  925.     }
  926.     public function getIsPdfMenuActive(): ?bool
  927.     {
  928.         return $this->isPdfMenuActive;
  929.     }
  930.     public function setIsPdfMenuActive(?bool $isPdfMenuActive): self
  931.     {
  932.         $this->isPdfMenuActive $isPdfMenuActive;
  933.         return $this;
  934.     }
  935.     /**
  936.      * @return Collection|InstitutionLocaleFront[]
  937.      */
  938.     public function getInstitutionLocaleFronts(): Collection|array
  939.     {
  940.         return $this->institutionLocaleFronts;
  941.     }
  942.     public function addInstitutionLocaleFront(InstitutionLocaleFront $institutionLocaleFront): self
  943.     {
  944.         if (!$this->institutionLocaleFronts->contains($institutionLocaleFront)) {
  945.             $this->institutionLocaleFronts[] = $institutionLocaleFront;
  946.             $institutionLocaleFront->setInstitution($this);
  947.         }
  948.         return $this;
  949.     }
  950.     public function removeInstitutionLocaleFront(InstitutionLocaleFront $institutionLocaleFront): self
  951.     {
  952.         if ($this->institutionLocaleFronts->removeElement($institutionLocaleFront)) {
  953.             // set the owning side to null (unless already changed)
  954.             if ($institutionLocaleFront->getInstitution() === $this) {
  955.                 $institutionLocaleFront->setInstitution(null);
  956.             }
  957.         }
  958.         return $this;
  959.     }
  960.     /**
  961.      * @return ArrayCollection
  962.      */
  963.     public function getActiveDishes(): ArrayCollection
  964.     {
  965.         $collections = new ArrayCollection();
  966.         foreach ($this->getDishes() as $dish) {
  967.             if ($dish->isActive()) {
  968.                 if (!$collections->contains($dish)) {
  969.                     $collections->add($dish);
  970.                 }
  971.             }
  972.         }
  973.         return $collections;
  974.     }
  975.     /**
  976.      * @return ArrayCollection
  977.      */
  978.     public function getActiveWines(): ArrayCollection
  979.     {
  980.         $collections = new ArrayCollection();
  981.         foreach ($this->getWines() as $wine) {
  982.             if ($wine->isActive()) {
  983.                 if (!$collections->contains($wine)) {
  984.                     $collections->add($wine);
  985.                 }
  986.             }
  987.         }
  988.         return $collections;
  989.     }
  990.     /**
  991.      * @return ArrayCollection
  992.      */
  993.     public function getActiveBeers(): ArrayCollection
  994.     {
  995.         $collections = new ArrayCollection();
  996.         foreach ($this->getBeers() as $beer) {
  997.             if ($beer->isActive()) {
  998.                 if (!$collections->contains($beer)) {
  999.                     $collections->add($beer);
  1000.                 }
  1001.             }
  1002.         }
  1003.         return $collections;
  1004.     }
  1005.     /**
  1006.      * @return ArrayCollection
  1007.      */
  1008.     public function getActiveDrinks(): ArrayCollection
  1009.     {
  1010.         $collections = new ArrayCollection();
  1011.         foreach ($this->getDrinks() as $drink) {
  1012.             if ($drink->isActive()) {
  1013.                 if (!$collections->contains($drink)) {
  1014.                     $collections->add($drink);
  1015.                 }
  1016.             }
  1017.         }
  1018.         return $collections;
  1019.     }
  1020.     /**
  1021.      * @return Collection|InstitutionReview[]
  1022.      */
  1023.     public function getInstitutionReviews(): Collection|array
  1024.     {
  1025.         return $this->institutionReviews;
  1026.     }
  1027.     public function addInstitutionReview(InstitutionReview $institutionReview): self
  1028.     {
  1029.         if (!$this->institutionReviews->contains($institutionReview)) {
  1030.             $this->institutionReviews[] = $institutionReview;
  1031.             $institutionReview->setInstitution($this);
  1032.         }
  1033.         return $this;
  1034.     }
  1035.     public function removeInstitutionReview(InstitutionReview $institutionReview): self
  1036.     {
  1037.         if ($this->institutionReviews->removeElement($institutionReview)) {
  1038.             // set the owning side to null (unless already changed)
  1039.             if ($institutionReview->getInstitution() === $this) {
  1040.                 $institutionReview->setInstitution(null);
  1041.             }
  1042.         }
  1043.         return $this;
  1044.     }
  1045.     public function getInstitutionReviewSummary(): ?InstitutionReviewSummary
  1046.     {
  1047.         return $this->institutionReviewSummary;
  1048.     }
  1049.     public function setInstitutionReviewSummary(?InstitutionReviewSummary $institutionReviewSummary): self
  1050.     {
  1051.         $this->institutionReviewSummary $institutionReviewSummary;
  1052.         // set (or unset) the owning side of the relation if necessary
  1053.         $newInstitution null === $institutionReviewSummary null $this;
  1054.         if ($institutionReviewSummary->getInstitution() !== $newInstitution) {
  1055.             $institutionReviewSummary->setInstitution($newInstitution);
  1056.         }
  1057.         return $this;
  1058.     }
  1059.     /**
  1060.      * @return Collection|Contest[]
  1061.      */
  1062.     public function getContests(): Collection|array
  1063.     {
  1064.         return $this->contests;
  1065.     }
  1066.     public function addContest(Contest $contest): self
  1067.     {
  1068.         if (!$this->contests->contains($contest)) {
  1069.             $this->contests[] = $contest;
  1070.             $contest->setInstitution($this);
  1071.         }
  1072.         return $this;
  1073.     }
  1074.     public function removeContest(Contest $contest): self
  1075.     {
  1076.         if ($this->contests->removeElement($contest)) {
  1077.             // set the owning side to null (unless already changed)
  1078.             if ($contest->getInstitution() === $this) {
  1079.                 $contest->setInstitution(null);
  1080.             }
  1081.         }
  1082.         return $this;
  1083.     }
  1084.     /**
  1085.      * @return Collection|Analysis[]
  1086.      */
  1087.     public function getAnalyses(): array|Collection
  1088.     {
  1089.         return $this->analyses;
  1090.     }
  1091.     public function addAnalysis(Analysis $analysis): self
  1092.     {
  1093.         if (!$this->analyses->contains($analysis)) {
  1094.             $this->analyses[] = $analysis;
  1095.             $analysis->setInstitution($this);
  1096.         }
  1097.         return $this;
  1098.     }
  1099.     public function removeAnalysis(Analysis $analysis): self
  1100.     {
  1101.         if ($this->analyses->removeElement($analysis)) {
  1102.             // set the owning side to null (unless already changed)
  1103.             if ($analysis->getInstitution() === $this) {
  1104.                 $analysis->setInstitution(null);
  1105.             }
  1106.         }
  1107.         return $this;
  1108.     }
  1109.     /**
  1110.      * @return Collection|Order[]
  1111.      */
  1112.     public function getOrders(): Collection|array
  1113.     {
  1114.         return $this->orders;
  1115.     }
  1116.     public function addOrder(Order $order): self
  1117.     {
  1118.         if (!$this->orders->contains($order)) {
  1119.             $this->orders[] = $order;
  1120.             $order->setInstitution($this);
  1121.         }
  1122.         return $this;
  1123.     }
  1124.     public function removeOrder(Order $order): self
  1125.     {
  1126.         if ($this->orders->removeElement($order)) {
  1127.             // set the owning side to null (unless already changed)
  1128.             if ($order->getInstitution() === $this) {
  1129.                 $order->setInstitution(null);
  1130.             }
  1131.         }
  1132.         return $this;
  1133.     }
  1134.     /**
  1135.      * @return Collection|ProductCategoryPosition[]
  1136.      */
  1137.     public function getProductCategoryPositions(): array|Collection
  1138.     {
  1139.         return $this->productCategoryPositions;
  1140.     }
  1141.     public function addProductCategoryPosition(ProductCategoryPosition $productCategoryPosition): self
  1142.     {
  1143.         if (!$this->productCategoryPositions->contains($productCategoryPosition)) {
  1144.             $this->productCategoryPositions[] = $productCategoryPosition;
  1145.             $productCategoryPosition->setInstitution($this);
  1146.         }
  1147.         return $this;
  1148.     }
  1149.     public function removeProductCategoryPosition(ProductCategoryPosition $productCategoryPosition): self
  1150.     {
  1151.         if ($this->productCategoryPositions->removeElement($productCategoryPosition)) {
  1152.             // set the owning side to null (unless already changed)
  1153.             if ($productCategoryPosition->getInstitution() === $this) {
  1154.                 $productCategoryPosition->setInstitution(null);
  1155.             }
  1156.         }
  1157.         return $this;
  1158.     }
  1159.     /**
  1160.      * @return Collection|Document[]
  1161.      */
  1162.     public function getGallery(): Collection|array
  1163.     {
  1164.         return $this->gallery;
  1165.     }
  1166.     public function addImageToGallery(Document $document): self
  1167.     {
  1168.         if (!$this->gallery->contains($document)) {
  1169.             $this->gallery[] = $document;
  1170.         }
  1171.         return $this;
  1172.     }
  1173.     public function removeImageFromGallery(Document $document): self
  1174.     {
  1175.         $this->gallery->removeElement($document);
  1176.         return $this;
  1177.     }
  1178.     public function resetGallery(): self
  1179.     {
  1180.         $this->gallery->clear();
  1181.         return $this;
  1182.     }
  1183.     public function getQrCodeLastDownloadAt(): ?DateTimeInterface
  1184.     {
  1185.         return $this->qrCodeLastDownloadAt;
  1186.     }
  1187.     public function setQrCodeLastDownloadAt(?DateTimeInterface $qrCodeLastDownloadAt): self
  1188.     {
  1189.         $this->qrCodeLastDownloadAt $qrCodeLastDownloadAt;
  1190.         return $this;
  1191.     }
  1192.     public function addGallery(Document $gallery): self
  1193.     {
  1194.         if (!$this->gallery->contains($gallery)) {
  1195.             $this->gallery[] = $gallery;
  1196.         }
  1197.         return $this;
  1198.     }
  1199.     public function removeGallery(Document $gallery): self
  1200.     {
  1201.         $this->gallery->removeElement($gallery);
  1202.         return $this;
  1203.     }
  1204. }