speakers = new ArrayCollection(); $this->tools = new ArrayCollection(); $this->establishmentGroups = new ArrayCollection(); } public function getId(): ?int { return $this->id; } /** * @return Collection */ public function getSpeakers(): Collection { return $this->speakers; } public function addSpeaker(Speaker $speaker): self { if (!$this->speakers->contains($speaker)) { $this->speakers[] = $speaker; } return $this; } public function removeSpeaker(Speaker $speaker): self { $this->speaker->removeElement($speaker); return $this; } public function getActivityReference(): ?string { return $this->activityReference; } public function setActivityReference(?string $activityReference): self { $this->activityReference = $activityReference; return $this; } public function getDate(): ?\DateTimeInterface { return $this->date; } public function setDate(?\DateTimeInterface $date): self { $this->date = $date; return $this; } public function getGroups(): ?int { return $this->groups; } public function setGroups(?int $groups): self { $this->groups = abs($groups); return $this; } public function getLevels(): ?string { return $this->levels; } public function setLevels(?string $levels): self { $this->levels = $levels; return $this; } public function getThemes(): ?string { return $this->themes; } public function setThemes(?string $themes): self { $this->themes = $themes; return $this; } public function getContent(): ?string { return $this->content; } public function setContent(?string $content): self { $this->content = $content; return $this; } /** * @return Collection */ public function getTools(): Collection { return $this->tools; } public function addTool(Tool $tool): self { if (!$this->tools->contains($tool)) { $this->tools[] = $tool; } return $this; } public function removeTool(Tool $tool): self { $this->tools->removeElement($tool); return $this; } public function getToolsDetails(): ?string { return $this->toolsDetails; } public function setToolsDetails(?string $toolsDetails): self { $this->toolsDetails = $toolsDetails; return $this; } public function getFeedback(): ?string { return $this->feedback; } public function setFeedback(?string $feedback): self { $this->feedback = $feedback; return $this; } public function getVigilantPoints(): ?string { return $this->vigilantPoints; } public function setVigilantPoints(?string $vigilantPoints): self { $this->vigilantPoints = $vigilantPoints; return $this; } public function getThemeType(): ?ThemeType { return $this->themeType; } public function setThemeType(?ThemeType $themeType): self { $this->themeType = $themeType; return $this; } public function getComment(): ?string { return $this->comment; } public function setComment(string $comment): self { $this->comment = $comment; return $this; } public function getEstablishments(): ArrayCollection { $data = new ArrayCollection(); foreach ($this->getEstablishmentGroups() as $group) { if (!$data->contains($group->getEstablishment())) { $data->add($group->getEstablishment()); } } $establishments = $data->toArray(); usort($establishments, function($a, $b) { return $a->getName() <=> $b->getName(); }); return new ArrayCollection($establishments); } /** * @return Collection */ public function getEstablishmentGroups(): Collection { return $this->establishmentGroups; } public function addEstablishmentGroup(EstablishmentGroup $establishmentGroup): self { if (!$this->establishmentGroups->contains($establishmentGroup)) { $this->establishmentGroups[] = $establishmentGroup; } return $this; } public function removeEstablishmentGroup(EstablishmentGroup $establishmentGroup): self { $this->establishmentGroups->removeElement($establishmentGroup); return $this; } public function getPrice(): ?float { return $this->price; } public function setPrice(?float $price): self { $this->price = $price; return $this; } }