reasons = new ArrayCollection(); $this->comment = new CommentEmbeddable(); $this->persons = new ArrayCollection(); $this->thirdParties = new ArrayCollection(); $this->documents = new ArrayCollection(); $this->users = new ArrayCollection(); $this->socialIssues = new ArrayCollection(); $this->socialActions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function setUser(UserInterface $user): self { $this->user = $user; return $this; } public function getUser(): User { return $this->user; } public function setDate(\DateTime $date): self { $this->date = $date; return $this; } public function getDate(): \DateTime { return $this->date; } public function setDurationTime(?\DateTime $durationTime): self { $this->durationTime = $durationTime; return $this; } public function getDurationTime(): ?\DateTime { return $this->durationTime; } public function setTravelTime(\DateTime $travelTime): self { $this->travelTime = $travelTime; return $this; } public function getTravelTime(): ?\DateTime { return $this->travelTime; } public function setAttendee(ActivityPresence $attendee): self { $this->attendee = $attendee; return $this; } public function getAttendee(): ?ActivityPresence { return $this->attendee; } public function addReason(ActivityReason $reason): self { $this->reasons->add($reason); return $this; } public function removeReason(ActivityReason $reason): void { $this->reasons->removeElement($reason); } public function getReasons(): Collection { return $this->reasons; } public function setReasons(?ArrayCollection $reasons): self { $this->reasons = $reasons; return $this; } public function getSocialIssues(): Collection { return $this->socialIssues; } public function addSocialIssue(SocialIssue $socialIssue): self { if (!$this->socialIssues->contains($socialIssue)) { $this->socialIssues[] = $socialIssue; } return $this; } public function removeSocialIssue(SocialIssue $socialIssue): self { $this->socialIssues->removeElement($socialIssue); return $this; } public function getSocialActions(): Collection { return $this->socialActions; } public function addSocialAction(SocialAction $socialAction): self { if (!$this->socialActions->contains($socialAction)) { $this->socialActions[] = $socialAction; } return $this; } public function removeSocialAction(SocialAction $socialAction): self { $this->socialActions->removeElement($socialAction); return $this; } public function setType(ActivityType $type): self { $this->type = $type; return $this; } public function getType(): ActivityType { return $this->type; } public function setScope(Scope $scope): self { $this->scope = $scope; return $this; } public function getScope(): ?Scope { return $this->scope; } public function setPerson(?Person $person): self { $this->person = $person; return $this; } public function getPerson(): ?Person { return $this->person; } public function getAccompanyingPeriod(): ?AccompanyingPeriod { return $this->accompanyingPeriod; } public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self { $this->accompanyingPeriod = $accompanyingPeriod; return $this; } /** * get the center * center is extracted from person */ public function getCenter(): ?Center { if ($this->person instanceof Person) { return $this->person->getCenter(); } return null; } public function getComment(): CommentEmbeddable { return $this->comment; } public function setComment(CommentEmbeddable $comment): self { $this->comment = $comment; return $this; } /** * Add a person to the person list */ public function addPerson(?Person $person): self { if (null !== $person) { $this->persons[] = $person; } return $this; } public function removePerson(Person $person): void { $this->persons->removeElement($person); } public function getPersons(): Collection { return $this->persons; } public function getPersonsAssociated(): array { if (null !== $this->accompanyingPeriod) { $personsAssociated = []; foreach ($this->accompanyingPeriod->getParticipations() as $participation) { if ($this->persons->contains($participation->getPerson())) { $personsAssociated[] = $participation->getPerson(); } } return $personsAssociated; } return []; } public function getPersonsNotAssociated(): array { if (null !== $this->accompanyingPeriod) { $personsNotAssociated = []; foreach ($this->persons as $person) { if (!in_array($person, $this->getPersonsAssociated())) { $personsNotAssociated[] = $person; } } return $personsNotAssociated; } return []; } public function setPersons(?Collection $persons): self { $this->persons = $persons; return $this; } public function addThirdParty(?ThirdParty $thirdParty): self { if (null !== $thirdParty) { $this->thirdParties[] = $thirdParty; } return $this; } public function removeThirdParty(ThirdParty $thirdParty): void { $this->thirdParties->removeElement($thirdParty); } public function getThirdParties(): Collection { return $this->thirdParties; } public function setThirdParties(?Collection $thirdParties): self { $this->thirdParties = $thirdParties; return $this; } public function addDocument(Document $document): self { $this->documents[] = $document; return $this; } public function removeDocument(Document $document): void { $this->documents->removeElement($document); } public function getDocuments(): Collection { return $this->documents; } public function setDocuments(Collection $documents): self { $this->documents = $documents; return $this; } public function addUser(?User $user): self { if (null !== $user) { $this->users[] = $user; } return $this; } public function removeUser(User $user): void { $this->users->removeElement($user); } public function getUsers(): Collection { return $this->users; } public function setUsers(?Collection $users): self { $this->users = $users; return $this; } public function isEmergency(): bool { return $this->getEmergency(); } public function getEmergency(): bool { return $this->emergency; } public function setEmergency(bool $emergency): self { $this->emergency = $emergency; return $this; } public function getSentReceived(): string { return $this->sentReceived; } public function setSentReceived(?string $sentReceived): self { $this->sentReceived = (string) $sentReceived; return $this; } /** * @return Location|null */ public function getLocation(): ?Location { return $this->location; } /** * @param Location|null $location * @return Activity */ public function setLocation(?Location $location): Activity { $this->location = $location; return $this; } }