goals = new ArrayCollection(); $this->privateComment = new PrivateCommentEmbeddable(); $this->results = new ArrayCollection(); $this->thirdParties = new ArrayCollection(); $this->persons = new ArrayCollection(); $this->accompanyingPeriodWorkEvaluations = new ArrayCollection(); $this->referrers = new ArrayCollection(); } public function addAccompanyingPeriodWorkEvaluation(AccompanyingPeriodWorkEvaluation $evaluation): self { if (!$this->accompanyingPeriodWorkEvaluations->contains($evaluation)) { $this->accompanyingPeriodWorkEvaluations[] = $evaluation; $evaluation->setAccompanyingPeriodWork($this); } return $this; } public function addGoal(AccompanyingPeriodWorkGoal $goal): self { if (!$this->goals->contains($goal)) { $this->goals[] = $goal; $goal->setAccompanyingPeriodWork($this); } return $this; } public function addPerson(Person $person): self { if (!$this->persons->contains($person)) { $this->persons[] = $person; } return $this; } public function addReferrer(User $referrer): self { if (!$this->referrers->contains($referrer)) { $this->referrers[] = $referrer; } return $this; } public function addResult(Result $result): self { if (!$this->results->contains($result)) { $this->results[] = $result; } return $this; } public function addThirdParty(ThirdParty $thirdParty): self { if (!$this->thirdParties->contains($thirdParty)) { $this->thirdParties[] = $thirdParty; } return $this; } public function getAccompanyingPeriod(): ?AccompanyingPeriod { return $this->accompanyingPeriod; } public function getAccompanyingPeriodWorkEvaluations(): Collection { return $this->accompanyingPeriodWorkEvaluations; } public function getCreatedAt(): ?DateTimeImmutable { return $this->createdAt; } public function getCreatedAutomatically(): ?bool { return $this->createdAutomatically; } public function getCreatedAutomaticallyReason(): ?string { return $this->createdAutomaticallyReason; } public function getCreatedBy(): ?User { return $this->createdBy; } public function getEndDate(): ?DateTimeInterface { return $this->endDate; } /** * @return AccompanyingPeriodWorkGoal[]|Collection */ public function getGoals(): Collection { return $this->goals; } public function getHandlingThierParty(): ?ThirdParty { return $this->handlingThierParty; } public function getId(): ?int { return $this->id; } public function getNote(): ?string { return $this->note; } public function getPersons(): Collection { return $this->persons; } public function getPrivateComment(): PrivateCommentEmbeddable { return $this->privateComment; } /** * @return Collection|User[] */ public function getReferrers(): Collection { return $this->referrers; } /** * @return Collection|Result[] */ public function getResults(): Collection { return $this->results; } public function getSocialAction(): ?SocialAction { return $this->socialAction; } public function getSocialIssues(): Collection { return new ArrayCollection([$this->getSocialAction()->getIssue()]); } public function getStartDate(): ?DateTimeInterface { return $this->startDate; } /** * @return Collection|ThirdParty[] */ public function getThirdParties(): Collection { return $this->thirdParties; } public function getThirdPartys(): Collection { return $this->getThirdParties(); } public function getUpdatedAt(): ?DateTimeImmutable { return $this->updatedAt; } public function getUpdatedBy(): ?User { return $this->updatedBy; } public function removeAccompanyingPeriodWorkEvaluation(AccompanyingPeriodWorkEvaluation $evaluation): self { $this->accompanyingPeriodWorkEvaluations ->removeElement($evaluation); $evaluation->setAccompanyingPeriodWork(null); return $this; } public function removeGoal(AccompanyingPeriodWorkGoal $goal): self { if ($this->goals->removeElement($goal)) { // set the owning side to null (unless already changed) if ($goal->getAccompanyingPeriodWork() === $this) { $goal->setAccompanyingPeriodWork(null); } } return $this; } public function removePerson(Person $person): self { $this->persons->removeElement($person); return $this; } public function removeReferrer(User $referrer): self { $this->referrers->removeElement($referrer); return $this; } public function removeResult(Result $result): self { $this->results->removeElement($result); return $this; } public function removeSocialIssue(SocialIssue $issue): AccompanyingPeriodLinkedWithSocialIssuesEntityInterface { $this->getSocialIssues()->removeElement($issue); return $this; } public function removeThirdParty(ThirdParty $thirdParty): self { $this->thirdParties->removeElement($thirdParty); return $this; } /** * Internal: you should use `$accompanyingPeriod->removeWork($work);` or * `$accompanyingPeriod->addWork($work);`. */ public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self { if ( $this->accompanyingPeriod instanceof AccompanyingPeriod && $accompanyingPeriod !== $this->accompanyingPeriod ) { throw new LogicException('A work cannot change accompanyingPeriod'); } $this->accompanyingPeriod = $accompanyingPeriod; return $this; } public function setCreatedAt(DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function setCreatedAutomatically(bool $createdAutomatically): self { $this->createdAutomatically = $createdAutomatically; return $this; } public function setCreatedAutomaticallyReason(string $createdAutomaticallyReason): self { $this->createdAutomaticallyReason = $createdAutomaticallyReason; return $this; } public function setCreatedBy(?User $createdBy): self { $this->createdBy = $createdBy; return $this; } public function setEndDate(?DateTimeInterface $endDate = null): self { $this->endDate = $endDate; return $this; } public function setHandlingThierParty(?ThirdParty $handlingThierParty): self { $this->handlingThierParty = $handlingThierParty; return $this; } public function setNote(string $note): self { $this->note = $note; return $this; } public function setPrivateComment(PrivateCommentEmbeddable $privateComment): self { $this->privateComment->merge($privateComment); return $this; } public function setSocialAction(?SocialAction $socialAction): self { $this->socialAction = $socialAction; return $this; } public function setStartDate(DateTimeInterface $startDate): self { $this->startDate = $startDate; return $this; } public function setUpdatedAt(DateTimeInterface $datetime): TrackUpdateInterface { $this->updatedAt = $datetime; return $this; } public function setUpdatedBy(User $user): TrackUpdateInterface { $this->updatedBy = $user; return $this; } }