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.     /**
  245.      * @ORM\ManyToOne(targetEntity="App\Entity\Currency", inversedBy="institutions")
  246.      * @ORM\JoinColumn(name="currency_id", referencedColumnName="id", nullable=true)
  247.      */
  248.     private ?Currency $institutionCurrency null;
  249.     public function __construct()
  250.     {
  251.         $this->isDefault false;
  252.         $this->dishCategories = new ArrayCollection();
  253.         $this->wineCategories = new ArrayCollection();
  254.         $this->beerCategories = new ArrayCollection();
  255.         $this->menuCategories = new ArrayCollection();
  256.         $this->dishes = new ArrayCollection();
  257.         $this->menus = new ArrayCollection();
  258.         $this->offers = new ArrayCollection();
  259.         $this->wines = new ArrayCollection();
  260.         $this->beers = new ArrayCollection();
  261.         $this->creations = new ArrayCollection();
  262.         $this->creationCategories = new ArrayCollection();
  263.         $this->drinks = new ArrayCollection();
  264.         $this->drinkCategories = new ArrayCollection();
  265.         $this->capacities = new ArrayCollection();
  266.         $this->winePairings = new ArrayCollection();
  267.         $this->beerPairings = new ArrayCollection();
  268.         $this->pdfmenuDocuments = new ArrayCollection();
  269.         $this->openingHours = new ArrayCollection();
  270.         $this->grapes = new ArrayCollection();
  271.         $this->isPdfMenuActive true;
  272.         $this->institutionLocaleFronts = new ArrayCollection();
  273.         $this->institutionReviews = new ArrayCollection();
  274.         $this->contests = new ArrayCollection();
  275.         $this->analyses = new ArrayCollection();
  276.         $this->orders = new ArrayCollection();
  277.         $this->productCategoryPositions = new ArrayCollection();
  278.         $this->gallery = new ArrayCollection();
  279.     }
  280.     public function getId(): ?int
  281.     {
  282.         return $this->id;
  283.     }
  284.     public function getName(): ?string
  285.     {
  286.         return $this->name;
  287.     }
  288.     public function setName(string $name): self
  289.     {
  290.         $this->name $name;
  291.         return $this;
  292.     }
  293.     public function getUrl(): ?string
  294.     {
  295.         return $this->url;
  296.     }
  297.     public function setUrl(?string $url): self
  298.     {
  299.         $this->url $url;
  300.         return $this;
  301.     }
  302.     public function getPhone(): ?string
  303.     {
  304.         return $this->phone;
  305.     }
  306.     public function setPhone(?string $phone): self
  307.     {
  308.         $this->phone $phone;
  309.         return $this;
  310.     }
  311.     public function isDefault(): ?bool
  312.     {
  313.         return $this->isDefault;
  314.     }
  315.     public function setIsDefault(bool $isDefault): self
  316.     {
  317.         $this->isDefault $isDefault;
  318.         return $this;
  319.     }
  320.     public function getFacebook(): ?string
  321.     {
  322.         return $this->facebook;
  323.     }
  324.     public function setFacebook(?string $facebook): self
  325.     {
  326.         $this->facebook $facebook;
  327.         return $this;
  328.     }
  329.     public function getInstagram(): ?string
  330.     {
  331.         return $this->instagram;
  332.     }
  333.     public function setInstagram(?string $instagram): self
  334.     {
  335.         $this->instagram $instagram;
  336.         return $this;
  337.     }
  338.     public function getFacebookToken(): ?string
  339.     {
  340.         return $this->facebookToken;
  341.     }
  342.     public function setFacebookToken(?string $facebookToken): self
  343.     {
  344.         $this->facebookToken $facebookToken;
  345.         return $this;
  346.     }
  347.     public function getSenderSms(): ?string
  348.     {
  349.         return $this->senderSms;
  350.     }
  351.     public function setSenderSms(?string $senderSms): self
  352.     {
  353.         $this->senderSms $senderSms;
  354.         return $this;
  355.     }
  356.     public function getHash(): ?string
  357.     {
  358.         return $this->hash;
  359.     }
  360.     public function setHash(?string $hash): self
  361.     {
  362.         $this->hash $hash;
  363.         return $this;
  364.     }
  365.     public function getLogo(): ?Document
  366.     {
  367.         return $this->logo;
  368.     }
  369.     public function setLogo(?Document $logo): self
  370.     {
  371.         $this->logo $logo;
  372.         return $this;
  373.     }
  374.     public function getUser(): ?User
  375.     {
  376.         return $this->user;
  377.     }
  378.     public function setUser(?User $user): self
  379.     {
  380.         $this->user $user;
  381.         return $this;
  382.     }
  383.     public function getAddress(): ?Address
  384.     {
  385.         return $this->address;
  386.     }
  387.     public function setAddress(?Address $address): self
  388.     {
  389.         $this->address $address;
  390.         return $this;
  391.     }
  392.     public function getQrCode(): ?Document
  393.     {
  394.         return $this->qrCode;
  395.     }
  396.     public function setQrCode(?Document $qrCode): self
  397.     {
  398.         $this->qrCode $qrCode;
  399.         return $this;
  400.     }
  401.     /**
  402.      * @return Collection|DishCategory[]
  403.      */
  404.     public function getDishCategories(): array|Collection
  405.     {
  406.         return $this->dishCategories;
  407.     }
  408.     public function addDishCategory(DishCategory $dishCategory): self
  409.     {
  410.         if (!$this->dishCategories->contains($dishCategory)) {
  411.             $this->dishCategories[] = $dishCategory;
  412.             $dishCategory->setInstitution($this);
  413.         }
  414.         return $this;
  415.     }
  416.     public function removeDishCategory(DishCategory $dishCategory): self
  417.     {
  418.         if ($this->dishCategories->contains($dishCategory)) {
  419.             $this->dishCategories->removeElement($dishCategory);
  420.             // set the owning side to null (unless already changed)
  421.             if ($dishCategory->getInstitution() === $this) {
  422.                 $dishCategory->setInstitution(null);
  423.             }
  424.         }
  425.         return $this;
  426.     }
  427.     /**
  428.      * @return Collection|WineCategory[]
  429.      */
  430.     public function getWineCategories(): array|Collection
  431.     {
  432.         return $this->wineCategories;
  433.     }
  434.     public function addWineCategory(WineCategory $wineCategory): self
  435.     {
  436.         if (!$this->wineCategories->contains($wineCategory)) {
  437.             $this->wineCategories[] = $wineCategory;
  438.             $wineCategory->setInstitution($this);
  439.         }
  440.         return $this;
  441.     }
  442.     public function removeWineCategory(WineCategory $wineCategory): self
  443.     {
  444.         if ($this->wineCategories->removeElement($wineCategory)) {
  445.             // set the owning side to null (unless already changed)
  446.             if ($wineCategory->getInstitution() === $this) {
  447.                 $wineCategory->setInstitution(null);
  448.             }
  449.         }
  450.         return $this;
  451.     }
  452.     /**
  453.      * @return Collection|BeerCategory[]
  454.      */
  455.     public function getBeerCategories(): array|Collection
  456.     {
  457.         return $this->beerCategories;
  458.     }
  459.     public function addBeerCategory(BeerCategory $beerCategory): self
  460.     {
  461.         if (!$this->beerCategories->contains($beerCategory)) {
  462.             $this->beerCategories[] = $beerCategory;
  463.             $beerCategory->setInstitution($this);
  464.         }
  465.         return $this;
  466.     }
  467.     public function removeBeerCategory(BeerCategory $beerCategory): self
  468.     {
  469.         if ($this->beerCategories->removeElement($beerCategory)) {
  470.             // set the owning side to null (unless already changed)
  471.             if ($beerCategory->getInstitution() === $this) {
  472.                 $beerCategory->setInstitution(null);
  473.             }
  474.         }
  475.         return $this;
  476.     }
  477.     /**
  478.      * @return Collection|Dish[]
  479.      */
  480.     public function getDishes(): array|Collection
  481.     {
  482.         return $this->dishes;
  483.     }
  484.     public function addDish(Dish $dish): self
  485.     {
  486.         if (!$this->dishes->contains($dish)) {
  487.             $this->dishes[] = $dish;
  488.             $dish->setInstitution($this);
  489.         }
  490.         return $this;
  491.     }
  492.     public function removeDish(Dish $dish): self
  493.     {
  494.         if ($this->dishes->contains($dish)) {
  495.             $this->dishes->removeElement($dish);
  496.             // set the owning side to null (unless already changed)
  497.             if ($dish->getInstitution() === $this) {
  498.                 $dish->setInstitution(null);
  499.             }
  500.         }
  501.         return $this;
  502.     }
  503.     /**
  504.      * @return Collection|Menu[]
  505.      */
  506.     public function getMenus(): array|Collection
  507.     {
  508.         return $this->menus;
  509.     }
  510.     public function addMenu(Menu $menu): self
  511.     {
  512.         if (!$this->menus->contains($menu)) {
  513.             $this->menus[] = $menu;
  514.             $menu->setInstitution($this);
  515.         }
  516.         return $this;
  517.     }
  518.     public function removeMenu(Menu $menu): self
  519.     {
  520.         if ($this->menus->contains($menu)) {
  521.             $this->menus->removeElement($menu);
  522.             // set the owning side to null (unless already changed)
  523.             if ($menu->getInstitution() === $this) {
  524.                 $menu->setInstitution(null);
  525.             }
  526.         }
  527.         return $this;
  528.     }
  529.     /**
  530.      * @return Collection|MenuCategory[]
  531.      */
  532.     public function getMenuCategories(): array|Collection
  533.     {
  534.         return $this->menuCategories;
  535.     }
  536.     public function addMenuCategory(MenuCategory $menuCategory): self
  537.     {
  538.         if (!$this->menuCategories->contains($menuCategory)) {
  539.             $this->menuCategories[] = $menuCategory;
  540.             $menuCategory->setInstitution($this);
  541.         }
  542.         return $this;
  543.     }
  544.     public function removeMenuCategory(MenuCategory $menuCategory): self
  545.     {
  546.         if ($this->menuCategories->removeElement($menuCategory)) {
  547.             // set the owning side to null (unless already changed)
  548.             if ($menuCategory->getInstitution() === $this) {
  549.                 $menuCategory->setInstitution(null);
  550.             }
  551.         }
  552.         return $this;
  553.     }
  554.     /**
  555.      * @return Collection|Offer[]
  556.      */
  557.     public function getOffers(): Collection|array
  558.     {
  559.         return $this->offers;
  560.     }
  561.     public function addOffer(Offer $offer): self
  562.     {
  563.         if (!$this->offers->contains($offer)) {
  564.             $this->offers[] = $offer;
  565.             $offer->setInstitution($this);
  566.         }
  567.         return $this;
  568.     }
  569.     public function removeOffer(Offer $offer): self
  570.     {
  571.         if ($this->offers->removeElement($offer)) {
  572.             // set the owning side to null (unless already changed)
  573.             if ($offer->getInstitution() === $this) {
  574.                 $offer->setInstitution(null);
  575.             }
  576.         }
  577.         return $this;
  578.     }
  579.     /**
  580.      * @return Collection|Wine[]
  581.      */
  582.     public function getWines(): array|Collection
  583.     {
  584.         return $this->wines;
  585.     }
  586.     public function addWine(Wine $wine): self
  587.     {
  588.         if (!$this->wines->contains($wine)) {
  589.             $this->wines[] = $wine;
  590.             $wine->setInstitution($this);
  591.         }
  592.         return $this;
  593.     }
  594.     public function removeWine(Wine $wine): self
  595.     {
  596.         if ($this->wines->contains($wine)) {
  597.             $this->wines->removeElement($wine);
  598.             // set the owning side to null (unless already changed)
  599.             if ($wine->getInstitution() === $this) {
  600.                 $wine->setInstitution(null);
  601.             }
  602.         }
  603.         return $this;
  604.     }
  605.     /**
  606.      * @return Collection|DrinkCategory[]
  607.      */
  608.     public function getDrinkCategories(): Collection|array
  609.     {
  610.         return $this->drinkCategories;
  611.     }
  612.     public function addDrinkCategory(DrinkCategory $drinkCategory): self
  613.     {
  614.         if (!$this->drinkCategories->contains($drinkCategory)) {
  615.             $this->drinkCategories[] = $drinkCategory;
  616.             $drinkCategory->setInstitution($this);
  617.         }
  618.         return $this;
  619.     }
  620.     public function removeDrinkCategory(DrinkCategory $drinkCategory): self
  621.     {
  622.         if ($this->drinkCategories->contains($drinkCategory)) {
  623.             $this->drinkCategories->removeElement($drinkCategory);
  624.             // set the owning side to null (unless already changed)
  625.             if ($drinkCategory->getInstitution() === $this) {
  626.                 $drinkCategory->setInstitution(null);
  627.             }
  628.         }
  629.         return $this;
  630.     }
  631.     /**
  632.      * @return Collection|Drink[]
  633.      */
  634.     public function getDrinks(): Collection|array
  635.     {
  636.         return $this->drinks;
  637.     }
  638.     public function addDrink(Drink $drink): self
  639.     {
  640.         if (!$this->drinks->contains($drink)) {
  641.             $this->drinks[] = $drink;
  642.             $drink->setInstitution($this);
  643.         }
  644.         return $this;
  645.     }
  646.     public function removeDrink(Drink $drink): self
  647.     {
  648.         if ($this->drinks->contains($drink)) {
  649.             $this->drinks->removeElement($drink);
  650.             // set the owning side to null (unless already changed)
  651.             if ($drink->getInstitution() === $this) {
  652.                 $drink->setInstitution(null);
  653.             }
  654.         }
  655.         return $this;
  656.     }
  657.     /**
  658.      * @return Collection|Beer[]
  659.      */
  660.     public function getBeers(): array|Collection
  661.     {
  662.         return $this->beers;
  663.     }
  664.     public function addBeer(Beer $beer): self
  665.     {
  666.         if (!$this->beers->contains($beer)) {
  667.             $this->beers[] = $beer;
  668.             $beer->setInstitution($this);
  669.         }
  670.         return $this;
  671.     }
  672.     public function removeBeer(Beer $beer): self
  673.     {
  674.         if ($this->beers->contains($beer)) {
  675.             $this->beers->removeElement($beer);
  676.             // set the owning side to null (unless already changed)
  677.             if ($beer->getInstitution() === $this) {
  678.                 $beer->setInstitution(null);
  679.             }
  680.         }
  681.         return $this;
  682.     }
  683.     /**
  684.      * @return Collection|Capacity[]
  685.      */
  686.     public function getCapacities(): Collection|array
  687.     {
  688.         return $this->capacities;
  689.     }
  690.     public function addCapacity(Capacity $capacity): self
  691.     {
  692.         if (!$this->capacities->contains($capacity)) {
  693.             $this->capacities[] = $capacity;
  694.             $capacity->setInstitution($this);
  695.         }
  696.         return $this;
  697.     }
  698.     public function removeCapacity(Capacity $capacity): self
  699.     {
  700.         if ($this->capacities->contains($capacity)) {
  701.             $this->capacities->removeElement($capacity);
  702.             // set the owning side to null (unless already changed)
  703.             if ($capacity->getInstitution() === $this) {
  704.                 $capacity->setInstitution(null);
  705.             }
  706.         }
  707.         return $this;
  708.     }
  709.     /**
  710.      * @return Collection|Creation[]
  711.      */
  712.     public function getCreations(): Collection|array
  713.     {
  714.         return $this->creations;
  715.     }
  716.     public function addCreation(Creation $creation): self
  717.     {
  718.         if (!$this->creations->contains($creation)) {
  719.             $this->creations[] = $creation;
  720.             $creation->setInstitution($this);
  721.         }
  722.         return $this;
  723.     }
  724.     public function removeCreation(Creation $creation): self
  725.     {
  726.         if ($this->creations->contains($creation)) {
  727.             $this->creations->removeElement($creation);
  728.             // set the owning side to null (unless already changed)
  729.             if ($creation->getInstitution() === $this) {
  730.                 $creation->setInstitution(null);
  731.             }
  732.         }
  733.         return $this;
  734.     }
  735.     /**
  736.      * @return Collection|CreationCategory[]
  737.      */
  738.     public function getCreationCategories(): Collection|array
  739.     {
  740.         return $this->creationCategories;
  741.     }
  742.     public function addCreationCategory(CreationCategory $creationCategory): self
  743.     {
  744.         if (!$this->creationCategories->contains($creationCategory)) {
  745.             $this->creationCategories[] = $creationCategory;
  746.             $creationCategory->setInstitution($this);
  747.         }
  748.         return $this;
  749.     }
  750.     public function removeCreationCategory(CreationCategory $creationCategory): self
  751.     {
  752.         if ($this->creationCategories->contains($creationCategory)) {
  753.             $this->creationCategories->removeElement($creationCategory);
  754.             // set the owning side to null (unless already changed)
  755.             if ($creationCategory->getInstitution() === $this) {
  756.                 $creationCategory->setInstitution(null);
  757.             }
  758.         }
  759.         return $this;
  760.     }
  761.     public function getIsDefault(): ?bool
  762.     {
  763.         return $this->isDefault;
  764.     }
  765.     /**
  766.      * @return Collection|WinePairing[]
  767.      */
  768.     public function getWinePairings(): array|Collection
  769.     {
  770.         return $this->winePairings;
  771.     }
  772.     public function addWinePairing(WinePairing $winePairing): self
  773.     {
  774.         if (!$this->winePairings->contains($winePairing)) {
  775.             $this->winePairings[] = $winePairing;
  776.             $winePairing->setInstitution($this);
  777.         }
  778.         return $this;
  779.     }
  780.     public function removeWinePairing(WinePairing $winePairing): self
  781.     {
  782.         if ($this->winePairings->contains($winePairing)) {
  783.             $this->winePairings->removeElement($winePairing);
  784.             // set the owning side to null (unless already changed)
  785.             if ($winePairing->getInstitution() === $this) {
  786.                 $winePairing->setInstitution(null);
  787.             }
  788.         }
  789.         return $this;
  790.     }
  791.     /**
  792.      * @return Collection|BeerPairing[]
  793.      */
  794.     public function getBeerPairings(): array|Collection
  795.     {
  796.         return $this->beerPairings;
  797.     }
  798.     public function addBeerPairing(BeerPairing $beerPairing): self
  799.     {
  800.         if (!$this->beerPairings->contains($beerPairing)) {
  801.             $this->beerPairings[] = $beerPairing;
  802.             $beerPairing->setInstitution($this);
  803.         }
  804.         return $this;
  805.     }
  806.     public function removeBeerPairing(BeerPairing $beerPairing): self
  807.     {
  808.         if ($this->beerPairings->contains($beerPairing)) {
  809.             $this->beerPairings->removeElement($beerPairing);
  810.             // set the owning side to null (unless already changed)
  811.             if ($beerPairing->getInstitution() === $this) {
  812.                 $beerPairing->setInstitution(null);
  813.             }
  814.         }
  815.         return $this;
  816.     }
  817.     /**
  818.      * @return Collection|PdfmenuDocument[]
  819.      */
  820.     public function getPdfmenuDocuments(): array|Collection
  821.     {
  822.         return $this->pdfmenuDocuments;
  823.     }
  824.     public function addPdfmenuDocument(PdfmenuDocument $pdfmenuDocument): self
  825.     {
  826.         if (!$this->pdfmenuDocuments->contains($pdfmenuDocument)) {
  827.             $this->pdfmenuDocuments[] = $pdfmenuDocument;
  828.             $pdfmenuDocument->setInstitution($this);
  829.         }
  830.         return $this;
  831.     }
  832.     public function removePdfmenuDocument(PdfmenuDocument $pdfmenuDocument): self
  833.     {
  834.         if ($this->pdfmenuDocuments->contains($pdfmenuDocument)) {
  835.             $this->pdfmenuDocuments->removeElement($pdfmenuDocument);
  836.             // set the owning side to null (unless already changed)
  837.             if ($pdfmenuDocument->getInstitution() === $this) {
  838.                 $pdfmenuDocument->setInstitution(null);
  839.             }
  840.         }
  841.         return $this;
  842.     }
  843.     public function getPdfmenuPersonalization(): ?PdfmenuPersonalization
  844.     {
  845.         return $this->pdfmenuPersonalization;
  846.     }
  847.     public function setPdfmenuPersonalization(?PdfmenuPersonalization $pdfmenuPersonalization): self
  848.     {
  849.         $this->pdfmenuPersonalization $pdfmenuPersonalization;
  850.         // set (or unset) the owning side of the relation if necessary
  851.         $newInstitution null === $pdfmenuPersonalization null $this;
  852.         if ($pdfmenuPersonalization->getInstitution() !== $newInstitution) {
  853.             $pdfmenuPersonalization->setInstitution($newInstitution);
  854.         }
  855.         return $this;
  856.     }
  857.     public function getInstitutionAppPersonalization(): ?InstitutionAppPersonalization
  858.     {
  859.         return $this->institutionAppPersonalization;
  860.     }
  861.     public function setInstitutionAppPersonalization(?InstitutionAppPersonalization $institutionAppPersonalization): self
  862.     {
  863.         $this->institutionAppPersonalization $institutionAppPersonalization;
  864.         // set (or unset) the owning side of the relation if necessary
  865.         $newInstitution null === $institutionAppPersonalization null $this;
  866.         if ($institutionAppPersonalization->getInstitution() !== $newInstitution) {
  867.             $institutionAppPersonalization->setInstitution($newInstitution);
  868.         }
  869.         return $this;
  870.     }
  871.     public function getDescription(): ?string
  872.     {
  873.         return $this->description;
  874.     }
  875.     public function setDescription(?string $description): self
  876.     {
  877.         $this->description $description;
  878.         return $this;
  879.     }
  880.     /**
  881.      * @return Collection|OpeningHour[]
  882.      */
  883.     public function getOpeningHours(): array|Collection
  884.     {
  885.         return $this->openingHours;
  886.     }
  887.     public function addOpeningHour(OpeningHour $openingHour): self
  888.     {
  889.         if (!$this->openingHours->contains($openingHour)) {
  890.             $this->openingHours[] = $openingHour;
  891.             $openingHour->setInstitution($this);
  892.         }
  893.         return $this;
  894.     }
  895.     public function removeOpeningHour(OpeningHour $openingHour): self
  896.     {
  897.         if ($this->openingHours->removeElement($openingHour)) {
  898.             // set the owning side to null (unless already changed)
  899.             if ($openingHour->getInstitution() === $this) {
  900.                 $openingHour->setInstitution(null);
  901.             }
  902.         }
  903.         return $this;
  904.     }
  905.     /**
  906.      * @return Collection|Grape[]
  907.      */
  908.     public function getGrapes(): Collection|array
  909.     {
  910.         return $this->grapes;
  911.     }
  912.     public function addGrape(Grape $grape): self
  913.     {
  914.         if (!$this->grapes->contains($grape)) {
  915.             $this->grapes[] = $grape;
  916.             $grape->setInstitution($this);
  917.         }
  918.         return $this;
  919.     }
  920.     public function removeGrape(Grape $grape): self
  921.     {
  922.         if ($this->grapes->contains($grape)) {
  923.             $this->grapes->removeElement($grape);
  924.             // set the owning side to null (unless already changed)
  925.             if ($grape->getInstitution() === $this) {
  926.                 $grape->setInstitution(null);
  927.             }
  928.         }
  929.         return $this;
  930.     }
  931.     public function getIsPdfMenuActive(): ?bool
  932.     {
  933.         return $this->isPdfMenuActive;
  934.     }
  935.     public function setIsPdfMenuActive(?bool $isPdfMenuActive): self
  936.     {
  937.         $this->isPdfMenuActive $isPdfMenuActive;
  938.         return $this;
  939.     }
  940.     /**
  941.      * @return Collection|InstitutionLocaleFront[]
  942.      */
  943.     public function getInstitutionLocaleFronts(): Collection|array
  944.     {
  945.         return $this->institutionLocaleFronts;
  946.     }
  947.     public function addInstitutionLocaleFront(InstitutionLocaleFront $institutionLocaleFront): self
  948.     {
  949.         if (!$this->institutionLocaleFronts->contains($institutionLocaleFront)) {
  950.             $this->institutionLocaleFronts[] = $institutionLocaleFront;
  951.             $institutionLocaleFront->setInstitution($this);
  952.         }
  953.         return $this;
  954.     }
  955.     public function removeInstitutionLocaleFront(InstitutionLocaleFront $institutionLocaleFront): self
  956.     {
  957.         if ($this->institutionLocaleFronts->removeElement($institutionLocaleFront)) {
  958.             // set the owning side to null (unless already changed)
  959.             if ($institutionLocaleFront->getInstitution() === $this) {
  960.                 $institutionLocaleFront->setInstitution(null);
  961.             }
  962.         }
  963.         return $this;
  964.     }
  965.     /**
  966.      * @return ArrayCollection
  967.      */
  968.     public function getActiveDishes(): ArrayCollection
  969.     {
  970.         $collections = new ArrayCollection();
  971.         foreach ($this->getDishes() as $dish) {
  972.             if ($dish->isActive()) {
  973.                 if (!$collections->contains($dish)) {
  974.                     $collections->add($dish);
  975.                 }
  976.             }
  977.         }
  978.         return $collections;
  979.     }
  980.     /**
  981.      * @return ArrayCollection
  982.      */
  983.     public function getActiveWines(): ArrayCollection
  984.     {
  985.         $collections = new ArrayCollection();
  986.         foreach ($this->getWines() as $wine) {
  987.             if ($wine->isActive()) {
  988.                 if (!$collections->contains($wine)) {
  989.                     $collections->add($wine);
  990.                 }
  991.             }
  992.         }
  993.         return $collections;
  994.     }
  995.     /**
  996.      * @return ArrayCollection
  997.      */
  998.     public function getActiveBeers(): ArrayCollection
  999.     {
  1000.         $collections = new ArrayCollection();
  1001.         foreach ($this->getBeers() as $beer) {
  1002.             if ($beer->isActive()) {
  1003.                 if (!$collections->contains($beer)) {
  1004.                     $collections->add($beer);
  1005.                 }
  1006.             }
  1007.         }
  1008.         return $collections;
  1009.     }
  1010.     /**
  1011.      * @return ArrayCollection
  1012.      */
  1013.     public function getActiveDrinks(): ArrayCollection
  1014.     {
  1015.         $collections = new ArrayCollection();
  1016.         foreach ($this->getDrinks() as $drink) {
  1017.             if ($drink->isActive()) {
  1018.                 if (!$collections->contains($drink)) {
  1019.                     $collections->add($drink);
  1020.                 }
  1021.             }
  1022.         }
  1023.         return $collections;
  1024.     }
  1025.     /**
  1026.      * @return Collection|InstitutionReview[]
  1027.      */
  1028.     public function getInstitutionReviews(): Collection|array
  1029.     {
  1030.         return $this->institutionReviews;
  1031.     }
  1032.     public function addInstitutionReview(InstitutionReview $institutionReview): self
  1033.     {
  1034.         if (!$this->institutionReviews->contains($institutionReview)) {
  1035.             $this->institutionReviews[] = $institutionReview;
  1036.             $institutionReview->setInstitution($this);
  1037.         }
  1038.         return $this;
  1039.     }
  1040.     public function removeInstitutionReview(InstitutionReview $institutionReview): self
  1041.     {
  1042.         if ($this->institutionReviews->removeElement($institutionReview)) {
  1043.             // set the owning side to null (unless already changed)
  1044.             if ($institutionReview->getInstitution() === $this) {
  1045.                 $institutionReview->setInstitution(null);
  1046.             }
  1047.         }
  1048.         return $this;
  1049.     }
  1050.     public function getInstitutionReviewSummary(): ?InstitutionReviewSummary
  1051.     {
  1052.         return $this->institutionReviewSummary;
  1053.     }
  1054.     public function setInstitutionReviewSummary(?InstitutionReviewSummary $institutionReviewSummary): self
  1055.     {
  1056.         $this->institutionReviewSummary $institutionReviewSummary;
  1057.         // set (or unset) the owning side of the relation if necessary
  1058.         $newInstitution null === $institutionReviewSummary null $this;
  1059.         if ($institutionReviewSummary->getInstitution() !== $newInstitution) {
  1060.             $institutionReviewSummary->setInstitution($newInstitution);
  1061.         }
  1062.         return $this;
  1063.     }
  1064.     /**
  1065.      * @return Collection|Contest[]
  1066.      */
  1067.     public function getContests(): Collection|array
  1068.     {
  1069.         return $this->contests;
  1070.     }
  1071.     public function addContest(Contest $contest): self
  1072.     {
  1073.         if (!$this->contests->contains($contest)) {
  1074.             $this->contests[] = $contest;
  1075.             $contest->setInstitution($this);
  1076.         }
  1077.         return $this;
  1078.     }
  1079.     public function removeContest(Contest $contest): self
  1080.     {
  1081.         if ($this->contests->removeElement($contest)) {
  1082.             // set the owning side to null (unless already changed)
  1083.             if ($contest->getInstitution() === $this) {
  1084.                 $contest->setInstitution(null);
  1085.             }
  1086.         }
  1087.         return $this;
  1088.     }
  1089.     /**
  1090.      * @return Collection|Analysis[]
  1091.      */
  1092.     public function getAnalyses(): array|Collection
  1093.     {
  1094.         return $this->analyses;
  1095.     }
  1096.     public function addAnalysis(Analysis $analysis): self
  1097.     {
  1098.         if (!$this->analyses->contains($analysis)) {
  1099.             $this->analyses[] = $analysis;
  1100.             $analysis->setInstitution($this);
  1101.         }
  1102.         return $this;
  1103.     }
  1104.     public function removeAnalysis(Analysis $analysis): self
  1105.     {
  1106.         if ($this->analyses->removeElement($analysis)) {
  1107.             // set the owning side to null (unless already changed)
  1108.             if ($analysis->getInstitution() === $this) {
  1109.                 $analysis->setInstitution(null);
  1110.             }
  1111.         }
  1112.         return $this;
  1113.     }
  1114.     /**
  1115.      * @return Collection|Order[]
  1116.      */
  1117.     public function getOrders(): Collection|array
  1118.     {
  1119.         return $this->orders;
  1120.     }
  1121.     public function addOrder(Order $order): self
  1122.     {
  1123.         if (!$this->orders->contains($order)) {
  1124.             $this->orders[] = $order;
  1125.             $order->setInstitution($this);
  1126.         }
  1127.         return $this;
  1128.     }
  1129.     public function removeOrder(Order $order): self
  1130.     {
  1131.         if ($this->orders->removeElement($order)) {
  1132.             // set the owning side to null (unless already changed)
  1133.             if ($order->getInstitution() === $this) {
  1134.                 $order->setInstitution(null);
  1135.             }
  1136.         }
  1137.         return $this;
  1138.     }
  1139.     /**
  1140.      * @return Collection|ProductCategoryPosition[]
  1141.      */
  1142.     public function getProductCategoryPositions(): array|Collection
  1143.     {
  1144.         return $this->productCategoryPositions;
  1145.     }
  1146.     public function addProductCategoryPosition(ProductCategoryPosition $productCategoryPosition): self
  1147.     {
  1148.         if (!$this->productCategoryPositions->contains($productCategoryPosition)) {
  1149.             $this->productCategoryPositions[] = $productCategoryPosition;
  1150.             $productCategoryPosition->setInstitution($this);
  1151.         }
  1152.         return $this;
  1153.     }
  1154.     public function removeProductCategoryPosition(ProductCategoryPosition $productCategoryPosition): self
  1155.     {
  1156.         if ($this->productCategoryPositions->removeElement($productCategoryPosition)) {
  1157.             // set the owning side to null (unless already changed)
  1158.             if ($productCategoryPosition->getInstitution() === $this) {
  1159.                 $productCategoryPosition->setInstitution(null);
  1160.             }
  1161.         }
  1162.         return $this;
  1163.     }
  1164.     /**
  1165.      * @return Collection|Document[]
  1166.      */
  1167.     public function getGallery(): Collection|array
  1168.     {
  1169.         return $this->gallery;
  1170.     }
  1171.     public function addImageToGallery(Document $document): self
  1172.     {
  1173.         if (!$this->gallery->contains($document)) {
  1174.             $this->gallery[] = $document;
  1175.         }
  1176.         return $this;
  1177.     }
  1178.     public function removeImageFromGallery(Document $document): self
  1179.     {
  1180.         $this->gallery->removeElement($document);
  1181.         return $this;
  1182.     }
  1183.     public function resetGallery(): self
  1184.     {
  1185.         $this->gallery->clear();
  1186.         return $this;
  1187.     }
  1188.     public function getQrCodeLastDownloadAt(): ?DateTimeInterface
  1189.     {
  1190.         return $this->qrCodeLastDownloadAt;
  1191.     }
  1192.     public function setQrCodeLastDownloadAt(?DateTimeInterface $qrCodeLastDownloadAt): self
  1193.     {
  1194.         $this->qrCodeLastDownloadAt $qrCodeLastDownloadAt;
  1195.         return $this;
  1196.     }
  1197.     public function addGallery(Document $gallery): self
  1198.     {
  1199.         if (!$this->gallery->contains($gallery)) {
  1200.             $this->gallery[] = $gallery;
  1201.         }
  1202.         return $this;
  1203.     }
  1204.     public function removeGallery(Document $gallery): self
  1205.     {
  1206.         $this->gallery->removeElement($gallery);
  1207.         return $this;
  1208.     }
  1209.     public function getInstitutionCurrency(): ?Currency
  1210.     {
  1211.         return $this->institutionCurrency;
  1212.     }
  1213.     public function setInstitutionCurrency(?Currency $currency): self
  1214.     {
  1215.         $this->institutionCurrency $currency;
  1216.         return $this;
  1217.     }
  1218. }