<?php
namespace App\Entity;
use App\Traits\Activeable;
use App\Traits\Creatable;
use App\Traits\Deleteable;
use App\Traits\Updateable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use DateTime;
use DateTimeInterface;
/**
* @ORM\Table(name="`institution`")
* @ORM\Entity()
* @Gedmo\SoftDeleteable(fieldName="deletedAt")
*/
class Institution
{
use Creatable, Updateable, Deleteable, Activeable;
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null;
/**
* @var string
*
* @ORM\Column(name="name", type="string")
*/
private string $name;
/**
* @var ?string
*
* @ORM\Column(name="url", type="string", nullable=true)
*/
private ?string $url = null;
/**
* @var ?string
*
* @ORM\Column(name="phone", type="string", nullable=true)
*/
private ?string $phone = null;
/**
* @var boolean
*
* @ORM\Column(name="is_default", type="boolean")
*/
private bool $isDefault;
/**
* @var ?string
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $facebook = null;
/**
* @var ?string
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $instagram = null;
/**
* @var ?string
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $facebookToken = null;
/**
* @var ?string
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $senderSms = null;
/**
* @var ?string
*
* @ORM\Column(name="hash", type="string", nullable=true)
*/
private ?string $hash = null;
/**
* @var ?DateTime
*
* @ORM\Column(type="datetime", nullable=true)
*/
private ?DateTime $qrCodeLastDownloadAt = null;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Document", cascade={"persist"})
* @ORM\JoinColumn(name="document_id", referencedColumnName="id")
*/
private ?Document $logo = null;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="institutions")
*/
private ?User $user = null;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Address", cascade={"persist"})
*/
private ?Address $address = null;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Document", cascade={"persist"})
*/
private ?Document $qrCode = null;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DishCategory", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $dishCategories;
/**
* @ORM\OneToMany(targetEntity="App\Entity\WineCategory", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $wineCategories;
/**
* @ORM\OneToMany(targetEntity="App\Entity\BeerCategory", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $beerCategories;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Dish", mappedBy="institution", cascade={"remove", "persist"})
* @ORM\OrderBy({"position" = "ASC"})
*/
private Collection $dishes;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Menu", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $menus;
/**
* @ORM\OneToMany(targetEntity="App\Entity\MenuCategory", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $menuCategories;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Offer", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $offers;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Wine", mappedBy="institution", cascade={"remove", "persist"})
* @ORM\OrderBy({"position" = "ASC"})
*/
private Collection $wines;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DrinkCategory", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $drinkCategories;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Drink", mappedBy="institution", cascade={"remove", "persist"})
* @ORM\OrderBy({"position" = "ASC"})
*/
private Collection $drinks;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Beer", mappedBy="institution", cascade={"remove", "persist"})
* @ORM\OrderBy({"position" = "ASC"})
*/
private Collection $beers;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Capacity", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $capacities;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Creation", mappedBy="institution", cascade={"remove", "persist"})
* @ORM\OrderBy({"updatedAt" = "DESC"})
*/
private Collection $creations;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CreationCategory", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $creationCategories;
/**
* @ORM\OneToMany(targetEntity="App\Entity\WinePairing", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $winePairings;
/**
* @ORM\OneToMany(targetEntity="App\Entity\BeerPairing", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $beerPairings;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PdfmenuDocument", mappedBy="institution", cascade={"remove", "persist"})
* @ORM\OrderBy({"position" = "ASC"})
*/
private Collection $pdfmenuDocuments;
/**
* @ORM\OneToOne(targetEntity="App\Entity\PdfmenuPersonalization", mappedBy="institution", cascade={"remove", "persist"})
*/
private ?PdfmenuPersonalization $pdfmenuPersonalization = null;
/**
* @ORM\OneToOne(targetEntity="App\Entity\InstitutionAppPersonalization", mappedBy="institution", cascade={"remove", "persist"})
*/
private ?InstitutionAppPersonalization $institutionAppPersonalization = null;
/**
* @var ?string
*
* @ORM\Column(type="text", nullable=true)
*/
private ?string $description = null;
/**
* @ORM\OneToMany(targetEntity="App\Entity\OpeningHour", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $openingHours;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Grape", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $grapes;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $isPdfMenuActive = null;
/**
* @ORM\OneToMany(targetEntity="App\Entity\InstitutionLocaleFront", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $institutionLocaleFronts;
/**
* @ORM\OneToMany(targetEntity="App\Entity\InstitutionReview", mappedBy="institution", cascade={"remove", "persist"})
* @ORM\OrderBy({"date" = "DESC"})
*/
private Collection $institutionReviews;
/**
* @ORM\OneToOne(targetEntity="App\Entity\InstitutionReviewSummary", mappedBy="institution", cascade={"remove", "persist"})
*/
private ?InstitutionReviewSummary $institutionReviewSummary = null;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Contest", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $contests;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Analysis", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $analyses;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Order", mappedBy="institution")
* @ORM\OrderBy({"createdAt" = "DESC"})
*/
private Collection $orders;
/**
* @ORM\OneToMany(targetEntity="App\Entity\ProductCategoryPosition", mappedBy="institution", cascade={"remove", "persist"})
*/
private Collection $productCategoryPositions;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Document", cascade={"persist"})
* @ORM\JoinTable(name="institution_gallery",
* joinColumns={@ORM\JoinColumn(name="institution_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="document_id", referencedColumnName="id")}
* )
*/
private Collection $gallery;
public function __construct()
{
$this->isDefault = false;
$this->dishCategories = new ArrayCollection();
$this->wineCategories = new ArrayCollection();
$this->beerCategories = new ArrayCollection();
$this->menuCategories = new ArrayCollection();
$this->dishes = new ArrayCollection();
$this->menus = new ArrayCollection();
$this->offers = new ArrayCollection();
$this->wines = new ArrayCollection();
$this->beers = new ArrayCollection();
$this->creations = new ArrayCollection();
$this->creationCategories = new ArrayCollection();
$this->drinks = new ArrayCollection();
$this->drinkCategories = new ArrayCollection();
$this->capacities = new ArrayCollection();
$this->winePairings = new ArrayCollection();
$this->beerPairings = new ArrayCollection();
$this->pdfmenuDocuments = new ArrayCollection();
$this->openingHours = new ArrayCollection();
$this->grapes = new ArrayCollection();
$this->isPdfMenuActive = true;
$this->institutionLocaleFronts = new ArrayCollection();
$this->institutionReviews = new ArrayCollection();
$this->contests = new ArrayCollection();
$this->analyses = new ArrayCollection();
$this->orders = new ArrayCollection();
$this->productCategoryPositions = new ArrayCollection();
$this->gallery = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self
{
$this->url = $url;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function isDefault(): ?bool
{
return $this->isDefault;
}
public function setIsDefault(bool $isDefault): self
{
$this->isDefault = $isDefault;
return $this;
}
public function getFacebook(): ?string
{
return $this->facebook;
}
public function setFacebook(?string $facebook): self
{
$this->facebook = $facebook;
return $this;
}
public function getInstagram(): ?string
{
return $this->instagram;
}
public function setInstagram(?string $instagram): self
{
$this->instagram = $instagram;
return $this;
}
public function getFacebookToken(): ?string
{
return $this->facebookToken;
}
public function setFacebookToken(?string $facebookToken): self
{
$this->facebookToken = $facebookToken;
return $this;
}
public function getSenderSms(): ?string
{
return $this->senderSms;
}
public function setSenderSms(?string $senderSms): self
{
$this->senderSms = $senderSms;
return $this;
}
public function getHash(): ?string
{
return $this->hash;
}
public function setHash(?string $hash): self
{
$this->hash = $hash;
return $this;
}
public function getLogo(): ?Document
{
return $this->logo;
}
public function setLogo(?Document $logo): self
{
$this->logo = $logo;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getAddress(): ?Address
{
return $this->address;
}
public function setAddress(?Address $address): self
{
$this->address = $address;
return $this;
}
public function getQrCode(): ?Document
{
return $this->qrCode;
}
public function setQrCode(?Document $qrCode): self
{
$this->qrCode = $qrCode;
return $this;
}
/**
* @return Collection|DishCategory[]
*/
public function getDishCategories(): array|Collection
{
return $this->dishCategories;
}
public function addDishCategory(DishCategory $dishCategory): self
{
if (!$this->dishCategories->contains($dishCategory)) {
$this->dishCategories[] = $dishCategory;
$dishCategory->setInstitution($this);
}
return $this;
}
public function removeDishCategory(DishCategory $dishCategory): self
{
if ($this->dishCategories->contains($dishCategory)) {
$this->dishCategories->removeElement($dishCategory);
// set the owning side to null (unless already changed)
if ($dishCategory->getInstitution() === $this) {
$dishCategory->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|WineCategory[]
*/
public function getWineCategories(): array|Collection
{
return $this->wineCategories;
}
public function addWineCategory(WineCategory $wineCategory): self
{
if (!$this->wineCategories->contains($wineCategory)) {
$this->wineCategories[] = $wineCategory;
$wineCategory->setInstitution($this);
}
return $this;
}
public function removeWineCategory(WineCategory $wineCategory): self
{
if ($this->wineCategories->removeElement($wineCategory)) {
// set the owning side to null (unless already changed)
if ($wineCategory->getInstitution() === $this) {
$wineCategory->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|BeerCategory[]
*/
public function getBeerCategories(): array|Collection
{
return $this->beerCategories;
}
public function addBeerCategory(BeerCategory $beerCategory): self
{
if (!$this->beerCategories->contains($beerCategory)) {
$this->beerCategories[] = $beerCategory;
$beerCategory->setInstitution($this);
}
return $this;
}
public function removeBeerCategory(BeerCategory $beerCategory): self
{
if ($this->beerCategories->removeElement($beerCategory)) {
// set the owning side to null (unless already changed)
if ($beerCategory->getInstitution() === $this) {
$beerCategory->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Dish[]
*/
public function getDishes(): array|Collection
{
return $this->dishes;
}
public function addDish(Dish $dish): self
{
if (!$this->dishes->contains($dish)) {
$this->dishes[] = $dish;
$dish->setInstitution($this);
}
return $this;
}
public function removeDish(Dish $dish): self
{
if ($this->dishes->contains($dish)) {
$this->dishes->removeElement($dish);
// set the owning side to null (unless already changed)
if ($dish->getInstitution() === $this) {
$dish->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Menu[]
*/
public function getMenus(): array|Collection
{
return $this->menus;
}
public function addMenu(Menu $menu): self
{
if (!$this->menus->contains($menu)) {
$this->menus[] = $menu;
$menu->setInstitution($this);
}
return $this;
}
public function removeMenu(Menu $menu): self
{
if ($this->menus->contains($menu)) {
$this->menus->removeElement($menu);
// set the owning side to null (unless already changed)
if ($menu->getInstitution() === $this) {
$menu->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|MenuCategory[]
*/
public function getMenuCategories(): array|Collection
{
return $this->menuCategories;
}
public function addMenuCategory(MenuCategory $menuCategory): self
{
if (!$this->menuCategories->contains($menuCategory)) {
$this->menuCategories[] = $menuCategory;
$menuCategory->setInstitution($this);
}
return $this;
}
public function removeMenuCategory(MenuCategory $menuCategory): self
{
if ($this->menuCategories->removeElement($menuCategory)) {
// set the owning side to null (unless already changed)
if ($menuCategory->getInstitution() === $this) {
$menuCategory->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Offer[]
*/
public function getOffers(): Collection|array
{
return $this->offers;
}
public function addOffer(Offer $offer): self
{
if (!$this->offers->contains($offer)) {
$this->offers[] = $offer;
$offer->setInstitution($this);
}
return $this;
}
public function removeOffer(Offer $offer): self
{
if ($this->offers->removeElement($offer)) {
// set the owning side to null (unless already changed)
if ($offer->getInstitution() === $this) {
$offer->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Wine[]
*/
public function getWines(): array|Collection
{
return $this->wines;
}
public function addWine(Wine $wine): self
{
if (!$this->wines->contains($wine)) {
$this->wines[] = $wine;
$wine->setInstitution($this);
}
return $this;
}
public function removeWine(Wine $wine): self
{
if ($this->wines->contains($wine)) {
$this->wines->removeElement($wine);
// set the owning side to null (unless already changed)
if ($wine->getInstitution() === $this) {
$wine->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|DrinkCategory[]
*/
public function getDrinkCategories(): Collection|array
{
return $this->drinkCategories;
}
public function addDrinkCategory(DrinkCategory $drinkCategory): self
{
if (!$this->drinkCategories->contains($drinkCategory)) {
$this->drinkCategories[] = $drinkCategory;
$drinkCategory->setInstitution($this);
}
return $this;
}
public function removeDrinkCategory(DrinkCategory $drinkCategory): self
{
if ($this->drinkCategories->contains($drinkCategory)) {
$this->drinkCategories->removeElement($drinkCategory);
// set the owning side to null (unless already changed)
if ($drinkCategory->getInstitution() === $this) {
$drinkCategory->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Drink[]
*/
public function getDrinks(): Collection|array
{
return $this->drinks;
}
public function addDrink(Drink $drink): self
{
if (!$this->drinks->contains($drink)) {
$this->drinks[] = $drink;
$drink->setInstitution($this);
}
return $this;
}
public function removeDrink(Drink $drink): self
{
if ($this->drinks->contains($drink)) {
$this->drinks->removeElement($drink);
// set the owning side to null (unless already changed)
if ($drink->getInstitution() === $this) {
$drink->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Beer[]
*/
public function getBeers(): array|Collection
{
return $this->beers;
}
public function addBeer(Beer $beer): self
{
if (!$this->beers->contains($beer)) {
$this->beers[] = $beer;
$beer->setInstitution($this);
}
return $this;
}
public function removeBeer(Beer $beer): self
{
if ($this->beers->contains($beer)) {
$this->beers->removeElement($beer);
// set the owning side to null (unless already changed)
if ($beer->getInstitution() === $this) {
$beer->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Capacity[]
*/
public function getCapacities(): Collection|array
{
return $this->capacities;
}
public function addCapacity(Capacity $capacity): self
{
if (!$this->capacities->contains($capacity)) {
$this->capacities[] = $capacity;
$capacity->setInstitution($this);
}
return $this;
}
public function removeCapacity(Capacity $capacity): self
{
if ($this->capacities->contains($capacity)) {
$this->capacities->removeElement($capacity);
// set the owning side to null (unless already changed)
if ($capacity->getInstitution() === $this) {
$capacity->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Creation[]
*/
public function getCreations(): Collection|array
{
return $this->creations;
}
public function addCreation(Creation $creation): self
{
if (!$this->creations->contains($creation)) {
$this->creations[] = $creation;
$creation->setInstitution($this);
}
return $this;
}
public function removeCreation(Creation $creation): self
{
if ($this->creations->contains($creation)) {
$this->creations->removeElement($creation);
// set the owning side to null (unless already changed)
if ($creation->getInstitution() === $this) {
$creation->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|CreationCategory[]
*/
public function getCreationCategories(): Collection|array
{
return $this->creationCategories;
}
public function addCreationCategory(CreationCategory $creationCategory): self
{
if (!$this->creationCategories->contains($creationCategory)) {
$this->creationCategories[] = $creationCategory;
$creationCategory->setInstitution($this);
}
return $this;
}
public function removeCreationCategory(CreationCategory $creationCategory): self
{
if ($this->creationCategories->contains($creationCategory)) {
$this->creationCategories->removeElement($creationCategory);
// set the owning side to null (unless already changed)
if ($creationCategory->getInstitution() === $this) {
$creationCategory->setInstitution(null);
}
}
return $this;
}
public function getIsDefault(): ?bool
{
return $this->isDefault;
}
/**
* @return Collection|WinePairing[]
*/
public function getWinePairings(): array|Collection
{
return $this->winePairings;
}
public function addWinePairing(WinePairing $winePairing): self
{
if (!$this->winePairings->contains($winePairing)) {
$this->winePairings[] = $winePairing;
$winePairing->setInstitution($this);
}
return $this;
}
public function removeWinePairing(WinePairing $winePairing): self
{
if ($this->winePairings->contains($winePairing)) {
$this->winePairings->removeElement($winePairing);
// set the owning side to null (unless already changed)
if ($winePairing->getInstitution() === $this) {
$winePairing->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|BeerPairing[]
*/
public function getBeerPairings(): array|Collection
{
return $this->beerPairings;
}
public function addBeerPairing(BeerPairing $beerPairing): self
{
if (!$this->beerPairings->contains($beerPairing)) {
$this->beerPairings[] = $beerPairing;
$beerPairing->setInstitution($this);
}
return $this;
}
public function removeBeerPairing(BeerPairing $beerPairing): self
{
if ($this->beerPairings->contains($beerPairing)) {
$this->beerPairings->removeElement($beerPairing);
// set the owning side to null (unless already changed)
if ($beerPairing->getInstitution() === $this) {
$beerPairing->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|PdfmenuDocument[]
*/
public function getPdfmenuDocuments(): array|Collection
{
return $this->pdfmenuDocuments;
}
public function addPdfmenuDocument(PdfmenuDocument $pdfmenuDocument): self
{
if (!$this->pdfmenuDocuments->contains($pdfmenuDocument)) {
$this->pdfmenuDocuments[] = $pdfmenuDocument;
$pdfmenuDocument->setInstitution($this);
}
return $this;
}
public function removePdfmenuDocument(PdfmenuDocument $pdfmenuDocument): self
{
if ($this->pdfmenuDocuments->contains($pdfmenuDocument)) {
$this->pdfmenuDocuments->removeElement($pdfmenuDocument);
// set the owning side to null (unless already changed)
if ($pdfmenuDocument->getInstitution() === $this) {
$pdfmenuDocument->setInstitution(null);
}
}
return $this;
}
public function getPdfmenuPersonalization(): ?PdfmenuPersonalization
{
return $this->pdfmenuPersonalization;
}
public function setPdfmenuPersonalization(?PdfmenuPersonalization $pdfmenuPersonalization): self
{
$this->pdfmenuPersonalization = $pdfmenuPersonalization;
// set (or unset) the owning side of the relation if necessary
$newInstitution = null === $pdfmenuPersonalization ? null : $this;
if ($pdfmenuPersonalization->getInstitution() !== $newInstitution) {
$pdfmenuPersonalization->setInstitution($newInstitution);
}
return $this;
}
public function getInstitutionAppPersonalization(): ?InstitutionAppPersonalization
{
return $this->institutionAppPersonalization;
}
public function setInstitutionAppPersonalization(?InstitutionAppPersonalization $institutionAppPersonalization): self
{
$this->institutionAppPersonalization = $institutionAppPersonalization;
// set (or unset) the owning side of the relation if necessary
$newInstitution = null === $institutionAppPersonalization ? null : $this;
if ($institutionAppPersonalization->getInstitution() !== $newInstitution) {
$institutionAppPersonalization->setInstitution($newInstitution);
}
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
/**
* @return Collection|OpeningHour[]
*/
public function getOpeningHours(): array|Collection
{
return $this->openingHours;
}
public function addOpeningHour(OpeningHour $openingHour): self
{
if (!$this->openingHours->contains($openingHour)) {
$this->openingHours[] = $openingHour;
$openingHour->setInstitution($this);
}
return $this;
}
public function removeOpeningHour(OpeningHour $openingHour): self
{
if ($this->openingHours->removeElement($openingHour)) {
// set the owning side to null (unless already changed)
if ($openingHour->getInstitution() === $this) {
$openingHour->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Grape[]
*/
public function getGrapes(): Collection|array
{
return $this->grapes;
}
public function addGrape(Grape $grape): self
{
if (!$this->grapes->contains($grape)) {
$this->grapes[] = $grape;
$grape->setInstitution($this);
}
return $this;
}
public function removeGrape(Grape $grape): self
{
if ($this->grapes->contains($grape)) {
$this->grapes->removeElement($grape);
// set the owning side to null (unless already changed)
if ($grape->getInstitution() === $this) {
$grape->setInstitution(null);
}
}
return $this;
}
public function getIsPdfMenuActive(): ?bool
{
return $this->isPdfMenuActive;
}
public function setIsPdfMenuActive(?bool $isPdfMenuActive): self
{
$this->isPdfMenuActive = $isPdfMenuActive;
return $this;
}
/**
* @return Collection|InstitutionLocaleFront[]
*/
public function getInstitutionLocaleFronts(): Collection|array
{
return $this->institutionLocaleFronts;
}
public function addInstitutionLocaleFront(InstitutionLocaleFront $institutionLocaleFront): self
{
if (!$this->institutionLocaleFronts->contains($institutionLocaleFront)) {
$this->institutionLocaleFronts[] = $institutionLocaleFront;
$institutionLocaleFront->setInstitution($this);
}
return $this;
}
public function removeInstitutionLocaleFront(InstitutionLocaleFront $institutionLocaleFront): self
{
if ($this->institutionLocaleFronts->removeElement($institutionLocaleFront)) {
// set the owning side to null (unless already changed)
if ($institutionLocaleFront->getInstitution() === $this) {
$institutionLocaleFront->setInstitution(null);
}
}
return $this;
}
/**
* @return ArrayCollection
*/
public function getActiveDishes(): ArrayCollection
{
$collections = new ArrayCollection();
foreach ($this->getDishes() as $dish) {
if ($dish->isActive()) {
if (!$collections->contains($dish)) {
$collections->add($dish);
}
}
}
return $collections;
}
/**
* @return ArrayCollection
*/
public function getActiveWines(): ArrayCollection
{
$collections = new ArrayCollection();
foreach ($this->getWines() as $wine) {
if ($wine->isActive()) {
if (!$collections->contains($wine)) {
$collections->add($wine);
}
}
}
return $collections;
}
/**
* @return ArrayCollection
*/
public function getActiveBeers(): ArrayCollection
{
$collections = new ArrayCollection();
foreach ($this->getBeers() as $beer) {
if ($beer->isActive()) {
if (!$collections->contains($beer)) {
$collections->add($beer);
}
}
}
return $collections;
}
/**
* @return ArrayCollection
*/
public function getActiveDrinks(): ArrayCollection
{
$collections = new ArrayCollection();
foreach ($this->getDrinks() as $drink) {
if ($drink->isActive()) {
if (!$collections->contains($drink)) {
$collections->add($drink);
}
}
}
return $collections;
}
/**
* @return Collection|InstitutionReview[]
*/
public function getInstitutionReviews(): Collection|array
{
return $this->institutionReviews;
}
public function addInstitutionReview(InstitutionReview $institutionReview): self
{
if (!$this->institutionReviews->contains($institutionReview)) {
$this->institutionReviews[] = $institutionReview;
$institutionReview->setInstitution($this);
}
return $this;
}
public function removeInstitutionReview(InstitutionReview $institutionReview): self
{
if ($this->institutionReviews->removeElement($institutionReview)) {
// set the owning side to null (unless already changed)
if ($institutionReview->getInstitution() === $this) {
$institutionReview->setInstitution(null);
}
}
return $this;
}
public function getInstitutionReviewSummary(): ?InstitutionReviewSummary
{
return $this->institutionReviewSummary;
}
public function setInstitutionReviewSummary(?InstitutionReviewSummary $institutionReviewSummary): self
{
$this->institutionReviewSummary = $institutionReviewSummary;
// set (or unset) the owning side of the relation if necessary
$newInstitution = null === $institutionReviewSummary ? null : $this;
if ($institutionReviewSummary->getInstitution() !== $newInstitution) {
$institutionReviewSummary->setInstitution($newInstitution);
}
return $this;
}
/**
* @return Collection|Contest[]
*/
public function getContests(): Collection|array
{
return $this->contests;
}
public function addContest(Contest $contest): self
{
if (!$this->contests->contains($contest)) {
$this->contests[] = $contest;
$contest->setInstitution($this);
}
return $this;
}
public function removeContest(Contest $contest): self
{
if ($this->contests->removeElement($contest)) {
// set the owning side to null (unless already changed)
if ($contest->getInstitution() === $this) {
$contest->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Analysis[]
*/
public function getAnalyses(): array|Collection
{
return $this->analyses;
}
public function addAnalysis(Analysis $analysis): self
{
if (!$this->analyses->contains($analysis)) {
$this->analyses[] = $analysis;
$analysis->setInstitution($this);
}
return $this;
}
public function removeAnalysis(Analysis $analysis): self
{
if ($this->analyses->removeElement($analysis)) {
// set the owning side to null (unless already changed)
if ($analysis->getInstitution() === $this) {
$analysis->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Order[]
*/
public function getOrders(): Collection|array
{
return $this->orders;
}
public function addOrder(Order $order): self
{
if (!$this->orders->contains($order)) {
$this->orders[] = $order;
$order->setInstitution($this);
}
return $this;
}
public function removeOrder(Order $order): self
{
if ($this->orders->removeElement($order)) {
// set the owning side to null (unless already changed)
if ($order->getInstitution() === $this) {
$order->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|ProductCategoryPosition[]
*/
public function getProductCategoryPositions(): array|Collection
{
return $this->productCategoryPositions;
}
public function addProductCategoryPosition(ProductCategoryPosition $productCategoryPosition): self
{
if (!$this->productCategoryPositions->contains($productCategoryPosition)) {
$this->productCategoryPositions[] = $productCategoryPosition;
$productCategoryPosition->setInstitution($this);
}
return $this;
}
public function removeProductCategoryPosition(ProductCategoryPosition $productCategoryPosition): self
{
if ($this->productCategoryPositions->removeElement($productCategoryPosition)) {
// set the owning side to null (unless already changed)
if ($productCategoryPosition->getInstitution() === $this) {
$productCategoryPosition->setInstitution(null);
}
}
return $this;
}
/**
* @return Collection|Document[]
*/
public function getGallery(): Collection|array
{
return $this->gallery;
}
public function addImageToGallery(Document $document): self
{
if (!$this->gallery->contains($document)) {
$this->gallery[] = $document;
}
return $this;
}
public function removeImageFromGallery(Document $document): self
{
$this->gallery->removeElement($document);
return $this;
}
public function resetGallery(): self
{
$this->gallery->clear();
return $this;
}
public function getQrCodeLastDownloadAt(): ?DateTimeInterface
{
return $this->qrCodeLastDownloadAt;
}
public function setQrCodeLastDownloadAt(?DateTimeInterface $qrCodeLastDownloadAt): self
{
$this->qrCodeLastDownloadAt = $qrCodeLastDownloadAt;
return $this;
}
public function addGallery(Document $gallery): self
{
if (!$this->gallery->contains($gallery)) {
$this->gallery[] = $gallery;
}
return $this;
}
public function removeGallery(Document $gallery): self
{
$this->gallery->removeElement($gallery);
return $this;
}
}