src/Entity/Gos/Events.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\Gos\Uniqskills\Certificate;
  4. use App\Repository\Gos\EventsRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. /**
  11.  * @ORM\Entity(repositoryClass=EventsRepository::class)
  12.  * @ORM\HasLifecycleCallbacks()
  13.  * @Vich\Uploadable()
  14.  */
  15. class Events
  16. {
  17.     /**
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $name;
  27.     /**
  28.      * @ORM\Column(type="datetime")
  29.      */
  30.     private $createdAt;
  31.     /**
  32.      * @ORM\Column(type="datetime", nullable=true)
  33.      */
  34.     private $updatedAt;
  35.     /**
  36.      * @ORM\Column(type="datetime", nullable=true)
  37.      */
  38.     private $startAt;
  39.     /**
  40.      * @ORM\Column(type="string", length=255, nullable=true)
  41.      */
  42.     private $eventAddress;
  43.     /**
  44.      * @ORM\Column(type="string", length=255, nullable=true)
  45.      */
  46.     private $eventCity;
  47.     /**
  48.      * @ORM\Column(type="string", length=255, nullable=true)
  49.      */
  50.     private $fanpage;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $pollLink;
  55.     /**
  56.      * @ORM\OneToOne(targetEntity=Events::class, cascade={"persist", "remove"})
  57.      */
  58.     private $nextEvent;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private $conferenceLecturesLink;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity=EventType::class, inversedBy="events")
  65.      * @ORM\JoinColumn(nullable=false)
  66.      */
  67.     private $eventType;
  68.     /**
  69.      * @ORM\OneToOne(targetEntity=ProductVariant::class, mappedBy="event")
  70.      */
  71.     private $productVariant;
  72.     /**
  73.      * @ORM\ManyToOne(targetEntity=EventFormula::class, inversedBy="events")
  74.      * @ORM\JoinColumn(nullable=true)
  75.      */
  76.     private $eventFormula;
  77.     /**
  78.      * @ORM\Column(type="string", length=255, nullable=true)
  79.      */
  80.     private $website;
  81.     /**
  82.      * @Vich\UploadableField(mapping="event_files", fileNameProperty="organizationalFileName")
  83.      * @Assert\File(maxSize="200M")
  84.      */
  85.     private $organizationalFile;
  86.     /**
  87.      * @ORM\Column(type="string", length=255, nullable=true)
  88.      */
  89.     private $organizationalFileName;
  90.     /**
  91.      * @ORM\OneToMany(targetEntity=EventFiles::class, mappedBy="event", orphanRemoval=true, cascade={"persist"})
  92.      */
  93.     private $eventFiles;
  94.     /**
  95.      * @ORM\OneToMany(targetEntity=EventNotificationScheduler::class, mappedBy="event")
  96.      */
  97.     private $eventNotificationSchedulers;
  98.     /**
  99.      * @ORM\OneToMany(targetEntity=Certificate::class, mappedBy="event", cascade={"persist", "remove"})
  100.      */
  101.     private $certificates;
  102.     /**
  103.      * @ORM\Column(type="boolean", nullable=true)
  104.      */
  105.     private $onlyPresentAreCertified;
  106.     /**
  107.      * @ORM\ManyToMany(targetEntity=User::class, inversedBy="presenceOnEvents")
  108.      * @ORM\JoinTable(name="user_presence")
  109.      */
  110.     private $presentUsers;
  111.     /**
  112.      * Not mapped field - to temporarily have user's orderPart, used to check access
  113.      * @var Collection
  114.      */
  115.     private $userOrderParts;
  116.     /**
  117.      * Not mapped field - to temporarily have user's access to event
  118.      */
  119.     private $userHasAccess false;
  120.     /**
  121.      * Not mapped field - to temporarily have user's certificate
  122.      */
  123.     private $userCertificates;
  124.     /**
  125.      * Not mapped field - to temporarily have participants
  126.      * @var Collection
  127.      */
  128.     private $participants;
  129.     /**
  130.      * @ORM\OneToMany(targetEntity=LeadFormResponse::class, mappedBy="event")
  131.      */
  132.     private $leadFormResponses;
  133.     /**
  134.      * @ORM\Column(type="text", length=1000, nullable=true)
  135.      */
  136.     private $googleCalendarUrl;
  137.     /**
  138.      * @ORM\Column(type="text", length=1000, nullable=true)
  139.      */
  140.     private $outlookCalendarUrl;
  141.     /**
  142.      * @Vich\UploadableField(mapping="event_files", fileNameProperty="iCalCalendarFileName")
  143.      * @Assert\File(maxSize="1M")
  144.      */
  145.     private $iCalCalendarFile;
  146.     /**
  147.      * @ORM\Column(type="string", length=255, nullable=true)
  148.      */
  149.     private $iCalCalendarFileName;
  150.     /**
  151.      * @ORM\Column(type="boolean", nullable=true)
  152.      */
  153.     private $dontSendNotifications;
  154.     /**
  155.      * @ORM\Column(type="boolean", options={"default": false})
  156.      */
  157.     private $sendEventShopNotifications false;
  158.     /**
  159.      * @ORM\ManyToOne(targetEntity=EventsPlatform::class)
  160.      */
  161.     private $eventPlatform;
  162.     /**
  163.      * @ORM\Column(type="string", length=255, nullable=true)
  164.      */
  165.     private $meetingLink;
  166.     /**
  167.      * @ORM\Column(type="string", length=255, nullable=true)
  168.      */
  169.     private $countdownTimer;
  170.     /**
  171.      * @ORM\Column(type="boolean", nullable=true)
  172.      */
  173.     private $isNano;
  174.     public function __construct()
  175.     {
  176.         $this->eventFiles = new ArrayCollection();
  177.         $this->eventNotificationSchedulers = new ArrayCollection();
  178.         $this->presentUsers = new ArrayCollection();
  179.         $this->userOrderParts = new ArrayCollection();
  180.         $this->leadFormResponses = new ArrayCollection();
  181.         $this->certificates = new ArrayCollection();
  182.         $this->participants = new ArrayCollection();
  183.     }
  184.     public function __toString()
  185.     {
  186.         return (string)$this->name;
  187.     }
  188.     /** @ORM\PrePersist() */
  189.     public function onPrePersist(): void
  190.     {
  191.         $this->createdAt = new \DateTime();
  192.     }
  193.     /** @ORM\PreUpdate() */
  194.     public function onPreUpdate(): void
  195.     {
  196.         $this->updatedAt = new \DateTime();
  197.     }
  198.     public function getId(): ?int
  199.     {
  200.         return $this->id;
  201.     }
  202.     public function getName(): ?string
  203.     {
  204.         return $this->name;
  205.     }
  206.     public function setName(string $name): self
  207.     {
  208.         $this->name $name;
  209.         return $this;
  210.     }
  211.     public function getCreatedAt(): ?\DateTimeInterface
  212.     {
  213.         return $this->createdAt;
  214.     }
  215.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  216.     {
  217.         $this->createdAt $createdAt;
  218.         return $this;
  219.     }
  220.     public function getUpdatedAt(): ?\DateTimeInterface
  221.     {
  222.         return $this->updatedAt;
  223.     }
  224.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  225.     {
  226.         $this->updatedAt $updatedAt;
  227.         return $this;
  228.     }
  229.     public function getStartAt(): ?\DateTimeInterface
  230.     {
  231.         return $this->startAt;
  232.     }
  233.     public function setStartAt(?\DateTimeInterface $startAt): self
  234.     {
  235.         $this->startAt $startAt;
  236.         return $this;
  237.     }
  238.     public function getEventAddress(): ?string
  239.     {
  240.         return $this->eventAddress;
  241.     }
  242.     public function setEventAddress(?string $eventAddress): self
  243.     {
  244.         $this->eventAddress $eventAddress;
  245.         return $this;
  246.     }
  247.     public function getEventCity(): ?string
  248.     {
  249.         return $this->eventCity;
  250.     }
  251.     public function setEventCity(?string $eventCity): self
  252.     {
  253.         $this->eventCity $eventCity;
  254.         return $this;
  255.     }
  256.     public function getFanpage(): ?string
  257.     {
  258.         return $this->fanpage;
  259.     }
  260.     public function setFanpage(?string $fanpage): self
  261.     {
  262.         $this->fanpage $fanpage;
  263.         return $this;
  264.     }
  265.     public function getPollLink(): ?string
  266.     {
  267.         return $this->pollLink;
  268.     }
  269.     public function setPollLink(?string $pollLink): self
  270.     {
  271.         $this->pollLink $pollLink;
  272.         return $this;
  273.     }
  274.     public function getNextEvent(): ?self
  275.     {
  276.         return $this->nextEvent;
  277.     }
  278.     public function setNextEvent(?self $nextEvent): self
  279.     {
  280.         $this->nextEvent $nextEvent;
  281.         return $this;
  282.     }
  283.     public function getConferenceLecturesLink(): ?string
  284.     {
  285.         return $this->conferenceLecturesLink;
  286.     }
  287.     public function setConferenceLecturesLink(?string $conferenceLecturesLink): self
  288.     {
  289.         $this->conferenceLecturesLink $conferenceLecturesLink;
  290.         return $this;
  291.     }
  292.     public function getEventType(): ?EventType
  293.     {
  294.         return $this->eventType;
  295.     }
  296.     public function setEventType(?EventType $eventType): self
  297.     {
  298.         $this->eventType $eventType;
  299.         return $this;
  300.     }
  301.     public function getProductVariant(): ?ProductVariant
  302.     {
  303.         return $this->productVariant;
  304.     }
  305.     public function setProductVariant(?ProductVariant $productVariant): self
  306.     {
  307.         if ($productVariant)
  308.         {
  309.             $productVariant->setEvent($this);
  310.         }
  311.         else
  312.         {
  313.             $this->productVariant->setEvent(null);
  314.         }
  315.         $this->productVariant $productVariant;
  316.         return $this;
  317.     }
  318.     public function getEventFormula(): ?EventFormula
  319.     {
  320.         return $this->eventFormula;
  321.     }
  322.     public function setEventFormula(?EventFormula $eventFormula): self
  323.     {
  324.         $this->eventFormula $eventFormula;
  325.         return $this;
  326.     }
  327.     public function getWebsite(): ?string
  328.     {
  329.         return $this->website;
  330.     }
  331.     public function setWebsite(?string $website): self
  332.     {
  333.         $this->website $website;
  334.         return $this;
  335.     }
  336.     public function getOrganizationalFile(): ?\Symfony\Component\HttpFoundation\File\File
  337.     {
  338.         return $this->organizationalFile;
  339.     }
  340.     public function setOrganizationalFile(?\Symfony\Component\HttpFoundation\File\File $file null): void
  341.     {
  342.         $this->organizationalFile $file;
  343.         if (null !== $file) {
  344.             $this->updatedAt = new \DateTimeImmutable();
  345.         }
  346.     }
  347.     public function getOrganizationalFileName(): ?string
  348.     {
  349.         return $this->organizationalFileName;
  350.     }
  351.     public function setOrganizationalFileName(?string $fileName): self
  352.     {
  353.         $this->organizationalFileName $fileName;
  354.         return $this;
  355.     }
  356.     /**
  357.      * @return Collection|EventFiles[]
  358.      */
  359.     public function getEventFiles(): Collection
  360.     {
  361.         return $this->eventFiles;
  362.     }
  363.     public function addEventFile(EventFiles $eventFile): self
  364.     {
  365.         if (!$this->eventFiles->contains($eventFile)) {
  366.             $this->eventFiles[] = $eventFile;
  367.             $eventFile->setEvent($this);
  368.         }
  369.         return $this;
  370.     }
  371.     public function removeEventFile(EventFiles $eventFile): self
  372.     {
  373.         if ($this->eventFiles->contains($eventFile)) {
  374.             $this->eventFiles->removeElement($eventFile);
  375.             // set the owning side to null (unless already changed)
  376.             if ($eventFile->getEvent() === $this) {
  377.                 $eventFile->setEvent(null);
  378.             }
  379.         }
  380.         return $this;
  381.     }
  382.     /**
  383.      * @return Collection|EventNotificationScheduler[]
  384.      */
  385.     public function getEventNotificationSchedulers(): Collection
  386.     {
  387.         return $this->eventNotificationSchedulers;
  388.     }
  389.     public function addEventNotificationScheduler(EventNotificationScheduler $eventNotificationScheduler): self
  390.     {
  391.         if (!$this->eventNotificationSchedulers->contains($eventNotificationScheduler)) {
  392.             $this->eventNotificationSchedulers[] = $eventNotificationScheduler;
  393.             $eventNotificationScheduler->setEvent($this);
  394.         }
  395.         return $this;
  396.     }
  397.     public function removeEventNotificationScheduler(EventNotificationScheduler $eventNotificationScheduler): self
  398.     {
  399.         if ($this->eventNotificationSchedulers->contains($eventNotificationScheduler)) {
  400.             $this->eventNotificationSchedulers->removeElement($eventNotificationScheduler);
  401.             // set the owning side to null (unless already changed)
  402.             if ($eventNotificationScheduler->getEvent() === $this) {
  403.                 $eventNotificationScheduler->setEvent(null);
  404.             }
  405.         }
  406.         return $this;
  407.     }
  408.     public function getCertificates(): Collection
  409.     {
  410.         return $this->certificates;
  411.     }
  412.     public function addCertificate(Certificate $certificate): self
  413.     {
  414.         if (!$this->certificates->contains($certificate))
  415.         {
  416.             $this->certificates[] = $certificate;
  417.             $certificate->setEvent($this);
  418.         }
  419.         return $this;
  420.     }
  421.     public function removeCertificate(Certificate $certificate): self
  422.     {
  423.         if ($this->certificates->contains($certificate))
  424.         {
  425.             $this->certificates->removeElement($certificate);
  426.             if ($certificate->getEvent() === $this)
  427.             {
  428.                 $certificate->setEvent(null);
  429.             }
  430.         }
  431.         return $this;
  432.     }
  433.     public function getOnlyPresentAreCertified(): ?bool
  434.     {
  435.         return $this->onlyPresentAreCertified;
  436.     }
  437.     public function setOnlyPresentAreCertified(?bool $onlyPresentAreCertified): self
  438.     {
  439.         $this->onlyPresentAreCertified $onlyPresentAreCertified;
  440.         return $this;
  441.     }
  442.     /**
  443.      * @return Collection|User[]
  444.      */
  445.     public function getPresentUsers(): Collection
  446.     {
  447.         return $this->presentUsers;
  448.     }
  449.     public function addPresentUser(User $presentUser): self
  450.     {
  451.         if (!$this->presentUsers->contains($presentUser)) {
  452.             $this->presentUsers[] = $presentUser;
  453.         }
  454.         return $this;
  455.     }
  456.     public function removePresentUser(User $presentUser): self
  457.     {
  458.         if ($this->presentUsers->contains($presentUser)) {
  459.             $this->presentUsers->removeElement($presentUser);
  460.         }
  461.         return $this;
  462.     }
  463.     public function getUserOrderParts(): Collection
  464.     {
  465.         return $this->userOrderParts;
  466.     }
  467.     public function initUserOrderParts(?array $collection = []): self
  468.     {
  469.         $this->userOrderParts = new ArrayCollection($collection);
  470.         return $this;
  471.     }
  472.     public function addUserOrderPart(OrderPart $userOrderPart): self
  473.     {
  474.         if (!$this->userOrderParts->contains($userOrderPart))
  475.         {
  476.             $this->userOrderParts[] = $userOrderPart;
  477.         }
  478.         return $this;
  479.     }
  480.     public function getParticipants(): Collection
  481.     {
  482.         return $this->participants;
  483.     }
  484.     public function initParticipants(?array $collection = []): self
  485.     {
  486.         $this->participants = new ArrayCollection($collection);
  487.         return $this;
  488.     }
  489.     public function addParticipants(array $participants): self
  490.     {
  491.         foreach ($participants as $user)
  492.         {
  493.             if (!$this->participants->contains($user))
  494.             {
  495.                 $this->participants[] = $user;
  496.             }
  497.         }
  498.         return $this;
  499.     }
  500.     /**
  501.      * @return mixed
  502.      */
  503.     public function getUserHasAccess()
  504.     {
  505.         return $this->userHasAccess;
  506.     }
  507.     /**
  508.      * @param mixed $userHasAccess
  509.      */
  510.     public function setUserHasAccess($userHasAccess): void
  511.     {
  512.         $this->userHasAccess $userHasAccess;
  513.     }
  514.     /**
  515.      * @return mixed
  516.      */
  517.     public function getUserCertificates()
  518.     {
  519.         return $this->userCertificates;
  520.     }
  521.     /**
  522.      * @param mixed $userCertificates
  523.      */
  524.     public function setUserCertificates($userCertificates): void
  525.     {
  526.         $this->userCertificates $userCertificates;
  527.     }
  528.     /**
  529.      * @return Collection|LeadFormResponse[]
  530.      */
  531.     public function getLeadFormResponses(): Collection
  532.     {
  533.         return $this->leadFormResponses;
  534.     }
  535.     public function addLeadFormResponse(LeadFormResponse $leadFormResponse): self
  536.     {
  537.         if (!$this->leadFormResponses->contains($leadFormResponse)) {
  538.             $this->leadFormResponses[] = $leadFormResponse;
  539.             $leadFormResponse->setEvent($this);
  540.         }
  541.         return $this;
  542.     }
  543.     public function removeLeadFormResponse(LeadFormResponse $leadFormResponse): self
  544.     {
  545.         if ($this->leadFormResponses->contains($leadFormResponse)) {
  546.             $this->leadFormResponses->removeElement($leadFormResponse);
  547.             // set the owning side to null (unless already changed)
  548.             if ($leadFormResponse->getEvent() === $this) {
  549.                 $leadFormResponse->setEvent(null);
  550.             }
  551.         }
  552.         return $this;
  553.     }
  554.     public function getGoogleCalendarUrl(): ?string
  555.     {
  556.         return $this->googleCalendarUrl;
  557.     }
  558.     public function setGoogleCalendarUrl(?string $googleCalendarUrl): self
  559.     {
  560.         $this->googleCalendarUrl $googleCalendarUrl;
  561.         return $this;
  562.     }
  563.     public function getOutlookCalendarUrl(): ?string
  564.     {
  565.         return $this->outlookCalendarUrl;
  566.     }
  567.     public function setOutlookCalendarUrl(?string $outlookCalendarUrl): self
  568.     {
  569.         $this->outlookCalendarUrl $outlookCalendarUrl;
  570.         return $this;
  571.     }
  572.     public function getICalCalendarFile(): ?\Symfony\Component\HttpFoundation\File\File
  573.     {
  574.         return $this->iCalCalendarFile;
  575.     }
  576.     public function setICalCalendarFile(?\Symfony\Component\HttpFoundation\File\File $file null): void
  577.     {
  578.         $this->iCalCalendarFile $file;
  579.         if (null !== $file) {
  580.             $this->updatedAt = new \DateTimeImmutable();
  581.         }
  582.     }
  583.     public function getICalCalendarFileName(): ?string
  584.     {
  585.         return $this->iCalCalendarFileName;
  586.     }
  587.     public function setICalCalendarFileName(?string $iCalCalendarFileName): self
  588.     {
  589.         $this->iCalCalendarFileName $iCalCalendarFileName;
  590.         return $this;
  591.     }
  592.     public function getDontSendNotifications(): ?bool
  593.     {
  594.         return $this->dontSendNotifications;
  595.     }
  596.     public function setDontSendNotifications(?bool $dontSendNotifications): self
  597.     {
  598.         $this->dontSendNotifications $dontSendNotifications;
  599.         return $this;
  600.     }
  601.     public function getSendEventShopNotifications(): ?bool
  602.     {
  603.         return $this->sendEventShopNotifications;
  604.     }
  605.     public function setSendEventShopNotifications(bool $sendEventShopNotifications): self
  606.     {
  607.         $this->sendEventShopNotifications $sendEventShopNotifications;
  608.         return $this;
  609.     }
  610.     public function getEventPlatform(): ?EventsPlatform
  611.     {
  612.         return $this->eventPlatform;
  613.     }
  614.     public function setEventPlatform(?EventsPlatform $eventPlatform): self
  615.     {
  616.         $this->eventPlatform $eventPlatform;
  617.         return $this;
  618.     }
  619.     public function getMeetingLink(): ?string
  620.     {
  621.         return $this->meetingLink;
  622.     }
  623.     public function setMeetingLink(?string $meetingLink): self
  624.     {
  625.         $this->meetingLink $meetingLink;
  626.         return $this;
  627.     }
  628.     public function getCountdownTimer(): ?string
  629.     {
  630.         return $this->countdownTimer;
  631.     }
  632.     public function setCountdownTimer(?string $countdownTimer): self
  633.     {
  634.         $this->countdownTimer $countdownTimer;
  635.         return $this;
  636.     }
  637.     public function isNano(): ?bool
  638.     {
  639.         return $this->isNano;
  640.     }
  641.     public function setIsNano(?bool $isNano): self
  642.     {
  643.         $this->isNano $isNano;
  644.         return $this;
  645.     }
  646. }