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