<?php
namespace App\Entity\Gos;
use App\Entity\Gos\Uniqskills\Certificate;
use App\Repository\Gos\EventsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=EventsRepository::class)
* @ORM\HasLifecycleCallbacks()
* @Vich\Uploadable()
*/
class Events
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $startAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $eventAddress;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $eventCity;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fanpage;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $pollLink;
/**
* @ORM\OneToOne(targetEntity=Events::class, cascade={"persist", "remove"})
*/
private $nextEvent;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $conferenceLecturesLink;
/**
* @ORM\ManyToOne(targetEntity=EventType::class, inversedBy="events")
* @ORM\JoinColumn(nullable=false)
*/
private $eventType;
/**
* @ORM\OneToOne(targetEntity=ProductVariant::class, mappedBy="event")
*/
private $productVariant;
/**
* @ORM\ManyToOne(targetEntity=EventFormula::class, inversedBy="events")
* @ORM\JoinColumn(nullable=true)
*/
private $eventFormula;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $website;
/**
* @Vich\UploadableField(mapping="event_files", fileNameProperty="organizationalFileName")
* @Assert\File(maxSize="200M")
*/
private $organizationalFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $organizationalFileName;
/**
* @ORM\OneToMany(targetEntity=EventFiles::class, mappedBy="event", orphanRemoval=true, cascade={"persist"})
*/
private $eventFiles;
/**
* @ORM\OneToMany(targetEntity=EventNotificationScheduler::class, mappedBy="event")
*/
private $eventNotificationSchedulers;
/**
* @ORM\OneToMany(targetEntity=Certificate::class, mappedBy="event", cascade={"persist", "remove"})
*/
private $certificates;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $onlyPresentAreCertified;
/**
* @ORM\ManyToMany(targetEntity=User::class, inversedBy="presenceOnEvents")
* @ORM\JoinTable(name="user_presence")
*/
private $presentUsers;
/**
* Not mapped field - to temporarily have user's orderPart, used to check access
* @var Collection
*/
private $userOrderParts;
/**
* Not mapped field - to temporarily have user's access to event
*/
private $userHasAccess = false;
/**
* Not mapped field - to temporarily have user's certificate
*/
private $userCertificates;
/**
* Not mapped field - to temporarily have participants
* @var Collection
*/
private $participants;
/**
* @ORM\OneToMany(targetEntity=LeadFormResponse::class, mappedBy="event")
*/
private $leadFormResponses;
/**
* @ORM\Column(type="text", length=1000, nullable=true)
*/
private $googleCalendarUrl;
/**
* @ORM\Column(type="text", length=1000, nullable=true)
*/
private $outlookCalendarUrl;
/**
* @Vich\UploadableField(mapping="event_files", fileNameProperty="iCalCalendarFileName")
* @Assert\File(maxSize="1M")
*/
private $iCalCalendarFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $iCalCalendarFileName;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $dontSendNotifications;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $sendEventShopNotifications = false;
/**
* @ORM\ManyToOne(targetEntity=EventsPlatform::class)
*/
private $eventPlatform;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $meetingLink;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $countdownTimer;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNano;
public function __construct()
{
$this->eventFiles = new ArrayCollection();
$this->eventNotificationSchedulers = new ArrayCollection();
$this->presentUsers = new ArrayCollection();
$this->userOrderParts = new ArrayCollection();
$this->leadFormResponses = new ArrayCollection();
$this->certificates = new ArrayCollection();
$this->participants = new ArrayCollection();
}
public function __toString()
{
return (string)$this->name;
}
/** @ORM\PrePersist() */
public function onPrePersist(): void
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function onPreUpdate(): void
{
$this->updatedAt = new \DateTime();
}
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 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 getStartAt(): ?\DateTimeInterface
{
return $this->startAt;
}
public function setStartAt(?\DateTimeInterface $startAt): self
{
$this->startAt = $startAt;
return $this;
}
public function getEventAddress(): ?string
{
return $this->eventAddress;
}
public function setEventAddress(?string $eventAddress): self
{
$this->eventAddress = $eventAddress;
return $this;
}
public function getEventCity(): ?string
{
return $this->eventCity;
}
public function setEventCity(?string $eventCity): self
{
$this->eventCity = $eventCity;
return $this;
}
public function getFanpage(): ?string
{
return $this->fanpage;
}
public function setFanpage(?string $fanpage): self
{
$this->fanpage = $fanpage;
return $this;
}
public function getPollLink(): ?string
{
return $this->pollLink;
}
public function setPollLink(?string $pollLink): self
{
$this->pollLink = $pollLink;
return $this;
}
public function getNextEvent(): ?self
{
return $this->nextEvent;
}
public function setNextEvent(?self $nextEvent): self
{
$this->nextEvent = $nextEvent;
return $this;
}
public function getConferenceLecturesLink(): ?string
{
return $this->conferenceLecturesLink;
}
public function setConferenceLecturesLink(?string $conferenceLecturesLink): self
{
$this->conferenceLecturesLink = $conferenceLecturesLink;
return $this;
}
public function getEventType(): ?EventType
{
return $this->eventType;
}
public function setEventType(?EventType $eventType): self
{
$this->eventType = $eventType;
return $this;
}
public function getProductVariant(): ?ProductVariant
{
return $this->productVariant;
}
public function setProductVariant(?ProductVariant $productVariant): self
{
if ($productVariant)
{
$productVariant->setEvent($this);
}
else
{
$this->productVariant->setEvent(null);
}
$this->productVariant = $productVariant;
return $this;
}
public function getEventFormula(): ?EventFormula
{
return $this->eventFormula;
}
public function setEventFormula(?EventFormula $eventFormula): self
{
$this->eventFormula = $eventFormula;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): self
{
$this->website = $website;
return $this;
}
public function getOrganizationalFile(): ?\Symfony\Component\HttpFoundation\File\File
{
return $this->organizationalFile;
}
public function setOrganizationalFile(?\Symfony\Component\HttpFoundation\File\File $file = null): void
{
$this->organizationalFile = $file;
if (null !== $file) {
$this->updatedAt = new \DateTimeImmutable();
}
}
public function getOrganizationalFileName(): ?string
{
return $this->organizationalFileName;
}
public function setOrganizationalFileName(?string $fileName): self
{
$this->organizationalFileName = $fileName;
return $this;
}
/**
* @return Collection|EventFiles[]
*/
public function getEventFiles(): Collection
{
return $this->eventFiles;
}
public function addEventFile(EventFiles $eventFile): self
{
if (!$this->eventFiles->contains($eventFile)) {
$this->eventFiles[] = $eventFile;
$eventFile->setEvent($this);
}
return $this;
}
public function removeEventFile(EventFiles $eventFile): self
{
if ($this->eventFiles->contains($eventFile)) {
$this->eventFiles->removeElement($eventFile);
// set the owning side to null (unless already changed)
if ($eventFile->getEvent() === $this) {
$eventFile->setEvent(null);
}
}
return $this;
}
/**
* @return Collection|EventNotificationScheduler[]
*/
public function getEventNotificationSchedulers(): Collection
{
return $this->eventNotificationSchedulers;
}
public function addEventNotificationScheduler(EventNotificationScheduler $eventNotificationScheduler): self
{
if (!$this->eventNotificationSchedulers->contains($eventNotificationScheduler)) {
$this->eventNotificationSchedulers[] = $eventNotificationScheduler;
$eventNotificationScheduler->setEvent($this);
}
return $this;
}
public function removeEventNotificationScheduler(EventNotificationScheduler $eventNotificationScheduler): self
{
if ($this->eventNotificationSchedulers->contains($eventNotificationScheduler)) {
$this->eventNotificationSchedulers->removeElement($eventNotificationScheduler);
// set the owning side to null (unless already changed)
if ($eventNotificationScheduler->getEvent() === $this) {
$eventNotificationScheduler->setEvent(null);
}
}
return $this;
}
public function getCertificates(): Collection
{
return $this->certificates;
}
public function addCertificate(Certificate $certificate): self
{
if (!$this->certificates->contains($certificate))
{
$this->certificates[] = $certificate;
$certificate->setEvent($this);
}
return $this;
}
public function removeCertificate(Certificate $certificate): self
{
if ($this->certificates->contains($certificate))
{
$this->certificates->removeElement($certificate);
if ($certificate->getEvent() === $this)
{
$certificate->setEvent(null);
}
}
return $this;
}
public function getOnlyPresentAreCertified(): ?bool
{
return $this->onlyPresentAreCertified;
}
public function setOnlyPresentAreCertified(?bool $onlyPresentAreCertified): self
{
$this->onlyPresentAreCertified = $onlyPresentAreCertified;
return $this;
}
/**
* @return Collection|User[]
*/
public function getPresentUsers(): Collection
{
return $this->presentUsers;
}
public function addPresentUser(User $presentUser): self
{
if (!$this->presentUsers->contains($presentUser)) {
$this->presentUsers[] = $presentUser;
}
return $this;
}
public function removePresentUser(User $presentUser): self
{
if ($this->presentUsers->contains($presentUser)) {
$this->presentUsers->removeElement($presentUser);
}
return $this;
}
public function getUserOrderParts(): Collection
{
return $this->userOrderParts;
}
public function initUserOrderParts(?array $collection = []): self
{
$this->userOrderParts = new ArrayCollection($collection);
return $this;
}
public function addUserOrderPart(OrderPart $userOrderPart): self
{
if (!$this->userOrderParts->contains($userOrderPart))
{
$this->userOrderParts[] = $userOrderPart;
}
return $this;
}
public function getParticipants(): Collection
{
return $this->participants;
}
public function initParticipants(?array $collection = []): self
{
$this->participants = new ArrayCollection($collection);
return $this;
}
public function addParticipants(array $participants): self
{
foreach ($participants as $user)
{
if (!$this->participants->contains($user))
{
$this->participants[] = $user;
}
}
return $this;
}
/**
* @return mixed
*/
public function getUserHasAccess()
{
return $this->userHasAccess;
}
/**
* @param mixed $userHasAccess
*/
public function setUserHasAccess($userHasAccess): void
{
$this->userHasAccess = $userHasAccess;
}
/**
* @return mixed
*/
public function getUserCertificates()
{
return $this->userCertificates;
}
/**
* @param mixed $userCertificates
*/
public function setUserCertificates($userCertificates): void
{
$this->userCertificates = $userCertificates;
}
/**
* @return Collection|LeadFormResponse[]
*/
public function getLeadFormResponses(): Collection
{
return $this->leadFormResponses;
}
public function addLeadFormResponse(LeadFormResponse $leadFormResponse): self
{
if (!$this->leadFormResponses->contains($leadFormResponse)) {
$this->leadFormResponses[] = $leadFormResponse;
$leadFormResponse->setEvent($this);
}
return $this;
}
public function removeLeadFormResponse(LeadFormResponse $leadFormResponse): self
{
if ($this->leadFormResponses->contains($leadFormResponse)) {
$this->leadFormResponses->removeElement($leadFormResponse);
// set the owning side to null (unless already changed)
if ($leadFormResponse->getEvent() === $this) {
$leadFormResponse->setEvent(null);
}
}
return $this;
}
public function getGoogleCalendarUrl(): ?string
{
return $this->googleCalendarUrl;
}
public function setGoogleCalendarUrl(?string $googleCalendarUrl): self
{
$this->googleCalendarUrl = $googleCalendarUrl;
return $this;
}
public function getOutlookCalendarUrl(): ?string
{
return $this->outlookCalendarUrl;
}
public function setOutlookCalendarUrl(?string $outlookCalendarUrl): self
{
$this->outlookCalendarUrl = $outlookCalendarUrl;
return $this;
}
public function getICalCalendarFile(): ?\Symfony\Component\HttpFoundation\File\File
{
return $this->iCalCalendarFile;
}
public function setICalCalendarFile(?\Symfony\Component\HttpFoundation\File\File $file = null): void
{
$this->iCalCalendarFile = $file;
if (null !== $file) {
$this->updatedAt = new \DateTimeImmutable();
}
}
public function getICalCalendarFileName(): ?string
{
return $this->iCalCalendarFileName;
}
public function setICalCalendarFileName(?string $iCalCalendarFileName): self
{
$this->iCalCalendarFileName = $iCalCalendarFileName;
return $this;
}
public function getDontSendNotifications(): ?bool
{
return $this->dontSendNotifications;
}
public function setDontSendNotifications(?bool $dontSendNotifications): self
{
$this->dontSendNotifications = $dontSendNotifications;
return $this;
}
public function getSendEventShopNotifications(): ?bool
{
return $this->sendEventShopNotifications;
}
public function setSendEventShopNotifications(bool $sendEventShopNotifications): self
{
$this->sendEventShopNotifications = $sendEventShopNotifications;
return $this;
}
public function getEventPlatform(): ?EventsPlatform
{
return $this->eventPlatform;
}
public function setEventPlatform(?EventsPlatform $eventPlatform): self
{
$this->eventPlatform = $eventPlatform;
return $this;
}
public function getMeetingLink(): ?string
{
return $this->meetingLink;
}
public function setMeetingLink(?string $meetingLink): self
{
$this->meetingLink = $meetingLink;
return $this;
}
public function getCountdownTimer(): ?string
{
return $this->countdownTimer;
}
public function setCountdownTimer(?string $countdownTimer): self
{
$this->countdownTimer = $countdownTimer;
return $this;
}
public function isNano(): ?bool
{
return $this->isNano;
}
public function setIsNano(?bool $isNano): self
{
$this->isNano = $isNano;
return $this;
}
}