<?php
namespace App\Entity;
use App\Repository\ElementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: ElementRepository::class)]
#[Gedmo\Loggable]
class Element
{
const TYPE_ACTIVITY = 'activities';
const TYPE_EVENTS = 'events';
const TYPE_HOTEL = 'hotels';
const TYPE_OTHER = 'others';
const TYPE_PLACES = 'places';
const TYPE_RESTAURANT = 'restaurants';
const TYPE_SITE = 'sites';
const TYPE_TOURAINEHOTEL = 'tourainehotel';
const TYPE_TAGS = 'tags';
const TYPE_UNKNOWN = '__unknown__';
const TYPE_GITESFRANCE = 'gites_france';
const TYPES_MSG = [
self::TYPE_ACTIVITY => 'activities',
self::TYPE_EVENTS => 'events',
self::TYPE_HOTEL => 'hotels',
self::TYPE_OTHER => 'others',
self::TYPE_PLACES => 'places',
self::TYPE_RESTAURANT => 'restaurants',
self::TYPE_SITE => 'sites',
self::TYPE_TAGS => 'tags',
self::TYPE_TOURAINEHOTEL => 'tourainehotel',
self::TYPE_UNKNOWN => '__unknown__',
self::TYPE_GITESFRANCE => 'gites_france'
];
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
#[Groups(['authorization', 'long-details', 'short-details'])]
private $id;
#[Gedmo\Locale]
private string $locale = 'fr';
#[ORM\Column(type: 'string', length: 255)]
#[Groups(['export', 'long-details', 'short-details', 'authorization', 'favorites', 'smo', 'smo-geojson'])]
private $reference;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Gedmo\Versioned]
#[Groups(['authorization', 'export', 'long-details', 'short-details'])]
private $address;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Gedmo\Versioned]
#[Groups('authorization')]
private $address2;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Gedmo\Versioned]
#[Groups('authorization')]
private $address3;
#[ORM\Column(type: 'string', length: 10, nullable: true)]
#[Gedmo\Versioned]
#[Groups(['export', 'long-details', 'short-details', 'authorization'])]
private $zipCode;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Gedmo\Versioned]
#[Groups(['export', 'long-details', 'short-details', 'authorization'])]
private $town;
#[ORM\Column(type: 'string', length: 10, nullable: true)]
#[Gedmo\Versioned]
#[Groups('export')]
private $inseeCode;
#[ORM\Column(type: 'array', nullable: true)]
#[Gedmo\Versioned]
#[Groups(['long-details', 'short-details'])]
private $phones = [];
#[ORM\Column(type: 'array', nullable: true)]
#[Gedmo\Versioned]
#[Groups(['long-details', 'short-details'])]
private $mails = [];
#[ORM\Column(type: 'array', nullable: true)]
#[Gedmo\Versioned]
#[Groups(['long-details', 'short-details'])]
private $website = [];
#[ORM\Column(type: 'float')]
#[Gedmo\Versioned]
#[Groups(['export', 'long-details', 'short-details', 'authorization', 'smo'])]
private $lat;
#[ORM\Column(type: 'float')]
#[Gedmo\Versioned]
#[Groups(['export', 'long-details', 'short-details', 'authorization', 'smo'])]
private $lng;
#[ORM\Column(type: 'integer')]
#[Gedmo\Versioned]
private $zone;
#[Gedmo\Translatable]
#[Groups(['export', 'long-details', 'short-details', 'authorization', 'geojson', 'favorites', 'smo', 'smo-geojson'])]
private $name;
#[ORM\Column(type: 'string', length: 255)]
#[Gedmo\Versioned]
private $nameFr;
#[ORM\Column(type: 'string', length: 255)]
#[Gedmo\Versioned]
private $nameEn;
#[Groups(['export', 'long-details', 'short-details', 'smo'])]
private $description;
#[ORM\Column(type: 'text', nullable: true)]
#[Gedmo\Versioned]
private $descriptionFr;
#[ORM\Column(type: 'text', nullable: true)]
#[Gedmo\Versioned]
private $descriptionEn;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Gedmo\Versioned]
#[Groups(['long-details', 'short-details', 'geojson', 'favorites', 'smo-geojson'])]
private $type;
#[ORM\Column(type: 'boolean', options: ["default" => false])]
#[Groups(['long-details', 'short-details'])]
private $hasPrice = false;
#[ORM\Column(type: 'boolean', options: ["default" => false])]
#[Groups(['long-details', 'short-details'])]
private $hasSchedule = false;
#[ORM\Column(type: 'boolean', options: ["default" => false])]
#[Groups(['long-details', 'short-details'])]
private $isOpen = false;
#[ORM\Column(type: 'boolean', options: ["default" => true])]
#[Gedmo\Versioned]
private $display = true;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Gedmo\Versioned]
#[Groups(['long-details', 'short-details'])]
private $pdm;
#[ORM\Column(type: 'datetime')]
private $createdAt;
#[ORM\Column(type: 'datetime')]
private $updatedAt;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: GoogleSearch::class)]
private $googleSearches;
#[ORM\ManyToMany(targetEntity: NomenclatureCode::class, inversedBy: 'elements')]
private $nomenclatureCodes;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: Picture::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
private $pictures;
#[ORM\ManyToMany(targetEntity: Contact::class, mappedBy: 'elements', cascade: ['persist'])]
private $contacts;
#[ORM\Column(type: 'text', nullable: true)]
#[Gedmo\Versioned]
private $anecdoteFr;
#[ORM\Column(type: 'text', nullable: true)]
#[Gedmo\Versioned]
private $anecdoteEn;
#[ORM\ManyToMany(targetEntity: User::class, mappedBy: 'element')]
private $users;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: ElementSource::class, orphanRemoval: true)]
private $elementSources;
#[ORM\OneToOne(mappedBy: 'element', targetEntity: Authorization::class, cascade: ['persist', 'remove'])]
#[Groups('authorization')]
private $authorization;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: Schedule::class, orphanRemoval: true)]
private $schedules;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: Price::class, orphanRemoval: true)]
private $prices;
#[ORM\OneToMany(mappedBy: 'elementStart', targetEntity: ElementDistance::class, orphanRemoval: true)]
private $elementStartDistances;
#[ORM\OneToMany(mappedBy: 'elementEnd', targetEntity: ElementDistance::class)]
private $elementEndDistances;
#[ORM\ManyToMany(targetEntity: Favorite::class, mappedBy: 'element')]
private $favorites;
#[Groups(['long-details', 'short-details', 'favorites'])]
private $distance;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: Terminal::class, orphanRemoval: true)]
private $terminals;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: Information::class, orphanRemoval: true)]
private $informations;
#[ORM\Column(type: 'boolean', nullable: true)]
private $groupmentTouraineHotels;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: Coordinates::class)]
private $coordinates;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: Task::class)]
private $tasks;
#[ORM\OneToOne(mappedBy: 'element', targetEntity: TypeHotel::class, cascade: ['persist', 'remove'])]
private $typeHotel;
#[ORM\OneToOne(inversedBy: 'element', targetEntity: ThMember::class, cascade: ['persist', 'remove'])]
private $thMember;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $nameDe;
#[ORM\Column(type: 'text', nullable: true)]
private $descriptionDe;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $nameNl;
#[ORM\Column(type: 'text', nullable: true)]
private $descriptionNl;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $nameIt;
#[ORM\Column(type: 'text', nullable: true)]
private $descriptionIt;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $nameEs;
#[ORM\Column(type: 'text', nullable: true)]
private $descriptionEs;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $namePt;
#[ORM\Column(type: 'text', nullable: true)]
private $descriptionPt;
#[ORM\OneToOne(mappedBy: 'element', targetEntity: HasConcierge::class, cascade: ['persist', 'remove'])]
private $hasConcierge;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: Manual::class)]
private $manuals;
#[ORM\OneToMany(mappedBy: 'element', targetEntity: Error::class, orphanRemoval: true)]
private $errors;
public function __construct()
{
$this->googleSearches = new ArrayCollection();
$this->nomenclatureCodes = new ArrayCollection();
$this->pictures = new ArrayCollection();
$this->contacts = new ArrayCollection();
$this->users = new ArrayCollection();
$this->elementSources = new ArrayCollection();
$this->schedules = new ArrayCollection();
$this->prices = new ArrayCollection();
$this->elementStartDistances = new ArrayCollection();
$this->elementEndDistances = new ArrayCollection();
$this->favorites = new ArrayCollection();
$this->terminals = new ArrayCollection();
$this->informations = new ArrayCollection();
$this->coordinates = new ArrayCollection();
$this->tasks = new ArrayCollection();
$this->manuals = new ArrayCollection();
$this->errors = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @param $locale
* @param bool $force
* @return Element
*/
public function setTranslatableLocale($locale, bool $force = false): self
{
$this->locale = $locale;
if ($force) {
if ('fr' === $locale) {
$this->name = $this->nameFr;
$this->description = $this->descriptionFr;
} else {
$this->name = $this->nameEn;
$this->description = $this->descriptionEn;
}
}
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(string $reference): self
{
$this->reference = $reference;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getAddress2(): ?string
{
return $this->address2;
}
public function setAddress2(?string $address2): self
{
$this->address2 = $address2;
return $this;
}
public function getAddress3(): ?string
{
return $this->address3;
}
public function setAddress3(?string $address3): self
{
$this->address3 = $address3;
return $this;
}
public function getZipCode(): ?string
{
return $this->zipCode;
}
public function setZipCode(?string $zipCode): self
{
$this->zipCode = $zipCode;
return $this;
}
public function getTown(): ?string
{
return $this->town;
}
public function setTown(?string $town): self
{
$this->town = $town;
return $this;
}
public function getInseeCode(): ?string
{
return $this->inseeCode;
}
public function setInseeCode(?string $inseeCode): self
{
$this->inseeCode = $inseeCode;
return $this;
}
public function getPhones(): ?array
{
return $this->phones;
}
public function setPhones(?array $phones): self
{
$this->phones = $phones;
return $this;
}
public function getMails(): ?array
{
return $this->mails;
}
public function setMails(?array $mails): self
{
$this->mails = $mails;
return $this;
}
public function getWebsite(): ?array
{
return $this->website;
}
public function setWebsite(?array $website): self
{
$this->website = $website;
return $this;
}
public function getLat(): ?float
{
return $this->lat;
}
public function setLat(float $lat): self
{
$this->lat = $lat;
return $this;
}
public function getLng(): ?float
{
return $this->lng;
}
public function setLng(float $lng): self
{
$this->lng = $lng;
return $this;
}
public function getZone(): ?int
{
return $this->zone;
}
public function setZone(int $zone): self
{
$this->zone = $zone;
return $this;
}
/**
* @return null|string
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string $name
* @param string|null $locale
* @return Element
*/
public function setName(string $name, string $locale = null): self
{
$locale = $locale ?? $this->locale;
if ('fr' === $locale) {
$this->nameFr = $name;
} else {
$this->nameEn = $name;
}
$this->name = $name;
return $this;
}
public function getNameFr(): ?string
{
return $this->nameFr;
}
public function setNameFr(string $nameFr): self
{
$this->nameFr = $nameFr;
return $this;
}
public function getNameEn(): ?string
{
return $this->nameEn;
}
public function setNameEn(string $nameEn): self
{
$this->nameEn = $nameEn;
return $this;
}
/**
* @return null|string
*/
public function getDescription(): ?string
{
return $this->description;
}
/**
* @param string $description
* @param string|null $locale
* @return Element
*/
public function setDescription(string $description, string $locale = null): self
{
$locale = $locale ?? $this->locale;
if ('fr' === $locale) {
$this->descriptionFr = $description;
} else {
$this->descriptionEn = $description;
}
$this->description = $description;
return $this;
}
public function getDescriptionFr(): ?string
{
return $this->descriptionFr;
}
public function setDescriptionFr(?string $descriptionFr): self
{
$this->descriptionFr = $descriptionFr;
return $this;
}
public function getDescriptionEn(): ?string
{
return $this->descriptionEn;
}
public function setDescriptionEn(?string $descriptionEn): self
{
$this->descriptionEn = $descriptionEn;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getHasPrice(): ?bool
{
return $this->hasPrice;
}
public function setHasPrice(bool $hasPrice): self
{
$this->hasPrice = $hasPrice;
return $this;
}
public function getHasSchedule(): ?bool
{
return $this->hasSchedule;
}
public function setHasSchedule(bool $hasSchedule): self
{
$this->hasSchedule = $hasSchedule;
return $this;
}
public function getIsOpen(): ?bool
{
return $this->isOpen;
}
public function setIsOpen(bool $isOpen): self
{
$this->isOpen = $isOpen;
return $this;
}
public function getDisplay(): ?bool
{
return $this->display;
}
public function setDisplay(bool $display): self
{
$this->display = $display;
return $this;
}
public function getPdm(): ?string
{
return $this->pdm;
}
public function setPdm(?string $pdm): self
{
$this->pdm = $pdm;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getDistance(): ?string
{
return $this->distance;
}
public function setDistance(?string $distance): self
{
$this->distance = $distance;
return $this;
}
/**
* @return Collection|GoogleSearch[]
*/
public function getGoogleSearches(): Collection
{
return $this->googleSearches;
}
public function addGoogleSearch(GoogleSearch $googleSearch): self
{
if (!$this->googleSearches->contains($googleSearch)) {
$this->googleSearches[] = $googleSearch;
$googleSearch->setElement($this);
}
return $this;
}
public function removeGoogleSearch(GoogleSearch $googleSearch): self
{
if ($this->googleSearches->removeElement($googleSearch)) {
// set the owning side to null (unless already changed)
if ($googleSearch->getElement() === $this) {
$googleSearch->setElement(null);
}
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getNomenclatureCode(): Collection
{
return $this->nomenclatureCodes;
}
public function addNomenclatureCode(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
public function addNomenclatureCodes(array $nomenclatureCodes): self
{
foreach($nomenclatureCodes as $nomenclatureCode) {
$this->addNomenclatureCode($nomenclatureCode);
}
return $this;
}
public function removeNomenclatureCode(NomenclatureCode $nomenclatureCode): self
{
$this->nomenclatureCodes->removeElement($nomenclatureCode);
return $this;
}
public function removeNomenclatureCodes(): self
{
$nomenclatureCodes = $this->getNomenclatureCode();
foreach($nomenclatureCodes as $nomenclatureCode) {
$this->removeNomenclatureCode($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getSpokenlanguages(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::SPOKENLANGUAGES !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::SPOKENLANGUAGES)) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addSpokenlanguage(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addSpokenlanguages(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addSpokenlanguage($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removeSpokenlanguage(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getGroupments(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::GROUPMENTS !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::GROUPMENTS)) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addGroupment(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addGroupments(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addGroupment($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removeGroupment(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getPublics(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::PUBLIC !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::PUBLIC)) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addPublic(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addPublics(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addPublic($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removePublic(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getPayments(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::MEANSOFPAYMENT !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::MEANSOFPAYMENT)) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addPayment(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addPayments(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addPayment($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removePayment(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getEquipments(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::EQUIPMENTS !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::EQUIPMENTS)) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addEquipment(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addEquipments(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addEquipment($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removeEquipment(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getServices(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::SERVICES !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::SERVICES)) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addService(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addServices(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addService($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removeService(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getAccessibilities(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::ACCESSIBILITIES !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::ACCESSIBILITIES)) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addAccessibility(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addAccessibilities(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addAccessibility($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removeAccessibility(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getCategories(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::CATEGORIES[$this->getType()] !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::CATEGORIES[$this->getType()])) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addCategory(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addCategories(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addCategory($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removeCategory(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|Picture[]
*/
public function getPictures(): Collection
{
return $this->pictures;
}
public function addPicture(Picture $picture): self
{
if (!$this->pictures->contains($picture)) {
$this->pictures[] = $picture;
$picture->setElement($this);
}
return $this;
}
public function removePicture(Picture $picture): self
{
if ($this->pictures->removeElement($picture)) {
// set the owning side to null (unless already changed)
if ($picture->getElement() === $this) {
$picture->setElement(null);
}
}
return $this;
}
public function getMainPicture(): Picture|null
{
foreach ($this->pictures as $picture) {
if ($picture->getMain()) {
return $picture;
}
}
return null;
}
/**
* @return Collection|Contact[]
*/
public function getContacts(): Collection
{
return $this->contacts;
}
public function addContact(Contact $contact): self
{
if (!$this->contacts->contains($contact)) {
$this->contacts[] = $contact;
$contact->addElement($this);
}
return $this;
}
public function removeContact(Contact $contact): self
{
if ($this->contacts->removeElement($contact)) {
$contact->removeElement($this);
}
return $this;
}
public function getAnecdoteFr(): ?string
{
return $this->anecdoteFr;
}
public function setAnecdoteFr(?string $anecdoteFr): self
{
$this->anecdoteFr = $anecdoteFr;
return $this;
}
public function getAnecdoteEn(): ?string
{
return $this->anecdoteEn;
}
public function setAnecdoteEn(?string $anecdoteEn): self
{
$this->anecdoteEn = $anecdoteEn;
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getAudiolanguages(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::AUDIOLANGUAGES !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::AUDIOLANGUAGES)) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addAudiolanguage(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addAudiolanguages(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addAudiolanguage($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removeAudiolanguage(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|NomenclatureCode[]
*/
public function getVisitlanguages(): Collection
{
$list = new ArrayCollection;
foreach ($this->nomenclatureCodes as $nomenclatureCode) {
if (NomenclatureCode::VISITLANGUAGES !== $nomenclatureCode->getShortCode()
&& str_contains($nomenclatureCode->getShortCode(), NomenclatureCode::VISITLANGUAGES)) {
$list[] = $nomenclatureCode;
}
}
return $list;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function addVisitlanguage(NomenclatureCode $nomenclatureCode): self
{
if (!$this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes[] = $nomenclatureCode;
}
return $this;
}
/**
* @param array $nomenclatureCodes
* @return Element
*/
public function addVisitlanguages(array $nomenclatureCodes): self
{
foreach ($nomenclatureCodes as $nomenclatureCode) {
$this->addVisitlanguage($nomenclatureCode);
}
return $this;
}
/**
* @param NomenclatureCode $nomenclatureCode
* @return Element
*/
public function removeVisitlanguage(NomenclatureCode $nomenclatureCode): self
{
if ($this->nomenclatureCodes->contains($nomenclatureCode)) {
$this->nomenclatureCodes->removeElement($nomenclatureCode);
}
return $this;
}
/**
* @return Collection|User[]
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->addElement($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->removeElement($user)) {
$user->removeElement($this);
}
return $this;
}
public function hasUser(User $user): bool
{
return $this->users->contains($user);
}
/**
* @return Collection|ElementSource[]
*/
public function getElementSources(): Collection
{
return $this->elementSources;
}
public function addElementSource(ElementSource $elementSource): self
{
if (!$this->elementSources->contains($elementSource)) {
$this->elementSources[] = $elementSource;
$elementSource->setElement($this);
}
return $this;
}
public function removeElementSource(ElementSource $elementSource): self
{
if ($this->elementSources->removeElement($elementSource)) {
// set the owning side to null (unless already changed)
if ($elementSource->getElement() === $this) {
$elementSource->setElement(null);
}
}
return $this;
}
public function getAuthorization(): ?Authorization
{
return $this->authorization;
}
public function setAuthorization(Authorization $authorization): self
{
// set the owning side of the relation if necessary
if ($authorization->getElement() !== $this) {
$authorization->setElement($this);
}
$this->authorization = $authorization;
return $this;
}
/**
* @return Collection|Schedule[]
*/
public function getSchedules(): Collection
{
return $this->schedules;
}
public function addSchedule(Schedule $schedule): self
{
if (!$this->schedules->contains($schedule)) {
$this->schedules[] = $schedule;
$schedule->setElement($this);
}
return $this;
}
public function removeSchedule(Schedule $schedule): self
{
if ($this->schedules->removeElement($schedule)) {
// set the owning side to null (unless already changed)
if ($schedule->getElement() === $this) {
$schedule->setElement(null);
}
}
return $this;
}
/**
* @return Collection|Price[]
*/
public function getPrices(): Collection
{
return $this->prices;
}
public function addPrice(Price $price): self
{
if (!$this->prices->contains($price)) {
$this->prices[] = $price;
$price->setElement($this);
}
return $this;
}
public function removePrice(Price $price): self
{
if ($this->prices->removeElement($price)) {
// set the owning side to null (unless already changed)
if ($price->getElement() === $this) {
$price->setElement(null);
}
}
return $this;
}
/**
* @return Collection|ElementDistance[]
*/
public function getElementStartDistances(): Collection
{
return $this->elementStartDistances;
}
public function addElementStartDistance(ElementDistance $elementStartDistance): self
{
if (!$this->elementStartDistances->contains($elementStartDistance)) {
$this->elementStartDistances[] = $elementStartDistance;
$elementStartDistance->setElementStart($this);
}
return $this;
}
public function removeElementStartDistance(ElementDistance $elementStartDistance): self
{
if ($this->elementStartDistances->removeElement($elementStartDistance)) {
// set the owning side to null (unless already changed)
if ($elementStartDistance->getElementStart() === $this) {
$elementStartDistance->setElementStart(null);
}
}
return $this;
}
/**
* @return Collection|ElementDistance[]
*/
public function getElementEndDistances(): Collection
{
return $this->elementEndDistances;
}
public function addElementEndDistance(ElementDistance $elementEndDistance): self
{
if (!$this->elementEndDistances->contains($elementEndDistance)) {
$this->elementEndDistances[] = $elementEndDistance;
$elementEndDistance->setElementEnd($this);
}
return $this;
}
public function removeElementEndDistance(ElementDistance $elementEndDistance): self
{
if ($this->elementEndDistances->removeElement($elementEndDistance)) {
// set the owning side to null (unless already changed)
if ($elementEndDistance->getElementEnd() === $this) {
$elementEndDistance->setElementEnd(null);
}
}
return $this;
}
/**
* @return Collection|Favorite[]
*/
public function getFavorites(): Collection
{
return $this->favorites;
}
public function addFavorite(Favorite $favorite): self
{
if (!$this->favorites->contains($favorite)) {
$this->favorites[] = $favorite;
$favorite->addElement($this);
}
return $this;
}
public function removeFavorite(Favorite $favorite): self
{
if ($this->favorites->removeElement($favorite)) {
$favorite->removeElement($this);
}
return $this;
}
/**
* @return Collection|Terminal[]
*/
public function getTerminals(): Collection
{
return $this->terminals;
}
public function addTerminal(Terminal $terminal): self
{
if (!$this->terminals->contains($terminal)) {
$this->terminals[] = $terminal;
$terminal->setElement($this);
}
return $this;
}
public function removeTerminal(Terminal $terminal): self
{
if ($this->terminals->removeElement($terminal)) {
// set the owning side to null (unless already changed)
if ($terminal->getElement() === $this) {
$terminal->setElement(null);
}
}
return $this;
}
/**
* @return Collection|Information[]
*/
public function getInformations(): Collection
{
return $this->informations;
}
public function addInformation(Information $information): self
{
if (!$this->informations->contains($information)) {
$this->informations[] = $information;
$information->setElement($this);
}
return $this;
}
public function removeInformation(Information $information): self
{
if ($this->informations->removeElement($information)) {
// set the owning side to null (unless already changed)
if ($information->getElement() === $this) {
$information->setElement(null);
}
}
return $this;
}
public function getGroupmentTouraineHotels(): ?bool
{
return $this->groupmentTouraineHotels;
}
public function setGroupmentTouraineHotels(?bool $groupmentTouraineHotels): self
{
$this->groupmentTouraineHotels = $groupmentTouraineHotels;
return $this;
}
/**
* @return Collection|Coordinates[]
*/
public function getCoordinates(): Collection
{
return $this->coordinates;
}
public function addCoordinate(Coordinates $coordinate): self
{
if (!$this->coordinates->contains($coordinate)) {
$this->coordinates[] = $coordinate;
$coordinate->setElement($this);
}
return $this;
}
public function removeCoordinate(Coordinates $coordinate): self
{
if ($this->coordinates->removeElement($coordinate)) {
// set the owning side to null (unless already changed)
if ($coordinate->getElement() === $this) {
$coordinate->setElement(null);
}
}
return $this;
}
/**
* @return Collection|Task[]
*/
public function getTasks(): Collection
{
return $this->tasks;
}
public function addTask(Task $task): self
{
if (!$this->tasks->contains($task)) {
$this->tasks[] = $task;
$task->setElement($this);
}
return $this;
}
public function removeTask(Task $task): self
{
if ($this->tasks->removeElement($task)) {
// set the owning side to null (unless already changed)
if ($task->getElement() === $this) {
$task->setElement(null);
}
}
return $this;
}
public function getTypeHotel(): ?TypeHotel
{
return $this->typeHotel;
}
public function setTypeHotel(TypeHotel $typeHotel): self
{
// set the owning side of the relation if necessary
if ($typeHotel->getElement() !== $this) {
$typeHotel->setElement($this);
}
$this->typeHotel = $typeHotel;
return $this;
}
public function getThMember(): ?ThMember
{
return $this->thMember;
}
public function setThMember(?ThMember $thMember): self
{
$this->thMember = $thMember;
return $this;
}
public function getNameDe(): ?string
{
return $this->nameDe;
}
public function setNameDe(?string $nameDe): self
{
$this->nameDe = $nameDe;
return $this;
}
public function getDescriptionDe(): ?string
{
return $this->descriptionDe;
}
public function setDescriptionDe(?string $descriptionDe): self
{
$this->descriptionDe = $descriptionDe;
return $this;
}
public function getNameNl(): ?string
{
return $this->nameNl;
}
public function setNameNl(?string $nameNl): self
{
$this->nameNl = $nameNl;
return $this;
}
public function getDescriptionNl(): ?string
{
return $this->descriptionNl;
}
public function setDescriptionNl(?string $descriptionNl): self
{
$this->descriptionNl = $descriptionNl;
return $this;
}
public function getNameIt(): ?string
{
return $this->nameIt;
}
public function setNameIt(?string $nameIt): self
{
$this->nameIt = $nameIt;
return $this;
}
public function getDescriptionIt(): ?string
{
return $this->descriptionIt;
}
public function setDescriptionIt(?string $descriptionIt): self
{
$this->descriptionIt = $descriptionIt;
return $this;
}
public function getNameEs(): ?string
{
return $this->nameEs;
}
public function setNameEs(?string $nameEs): self
{
$this->nameEs = $nameEs;
return $this;
}
public function getDescriptionEs(): ?string
{
return $this->descriptionEs;
}
public function setDescriptionEs(?string $descriptionEs): self
{
$this->descriptionEs = $descriptionEs;
return $this;
}
public function getNamePt(): ?string
{
return $this->namePt;
}
public function setNamePt(?string $namePt): self
{
$this->namePt = $namePt;
return $this;
}
public function getDescriptionPt(): ?string
{
return $this->descriptionPt;
}
public function setDescriptionPt(?string $descriptionPt): self
{
$this->descriptionPt = $descriptionPt;
return $this;
}
public function getHasConcierge(): ?HasConcierge
{
return $this->hasConcierge;
}
public function setHasConcierge(HasConcierge $hasConcierge): self
{
// set the owning side of the relation if necessary
if ($hasConcierge->getElement() !== $this) {
$hasConcierge->setElement($this);
}
$this->hasConcierge = $hasConcierge;
return $this;
}
/**
* @return Collection
*/
public function getManuals(): Collection
{
return $this->manuals;
}
public function addManual(Manual $manual): self
{
if (!$this->manuals->contains($manual)) {
$this->manuals[] = $manual;
$manual->setElement($this);
}
return $this;
}
public function removeManual(Manual $manual): self
{
if ($this->manuals->removeElement($manual)) {
// set the owning side to null (unless already changed)
if ($manual->getElement() === $this) {
$manual->setElement(null);
}
}
return $this;
}
/**
* @return Collection|Error[]
*/
public function getErrors(): Collection
{
return $this->errors;
}
public function addError(Error $error): self
{
if (!$this->errors->contains($error)) {
$this->errors[] = $error;
$error->setElement($this);
}
return $this;
}
public function removeError(Error $error): self
{
if ($this->errors->removeElement($error)) {
// set the owning side to null (unless already changed)
if ($error->getElement() === $this) {
$error->setElement(null);
}
}
return $this;
}
}