From 0f9a395dfc26103915a9ac189a359190408524fa Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 27 Apr 2021 15:10:56 +0200 Subject: [PATCH] Entites for AccomanyingPeriodWork, AccomanyingPeriodWorkGoal & Social/WorkEvaluation --- .../AccompanyingPeriodWork.php | 309 ++++++++++++++++++ .../AccompanyingPeriodWorkGoal.php | 115 +++++++ .../Entity/SocialWork/Evaluation.php | 93 ++++++ .../Entity/SocialWork/Result.php | 62 ++++ .../AccompanyingPeriodWorkGoalRepository.php | 21 ++ .../AccompanyingPeriodWorkRepository.php | 21 ++ .../SocialWork/EvaluationRepository.php | 21 ++ 7 files changed, 642 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php create mode 100644 src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php create mode 100644 src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php new file mode 100644 index 000000000..92279be2d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -0,0 +1,309 @@ +goals = new ArrayCollection(); + $this->results = new ArrayCollection(); + $this->thirdParties = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getNote(): ?string + { + return $this->note; + } + + public function setNote(string $note): self + { + $this->note = $note; + + return $this; + } + + public function getAccompanyingPeriod(): ?AccompanyingPeriod + { + return $this->accompanyingPeriod; + } + + public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self + { + $this->accompanyingPeriod = $accompanyingPeriod; + + return $this; + } + + public function getSocialAction(): ?SocialAction + { + return $this->socialAction; + } + + public function setSocialAction(?SocialAction $socialAction): self + { + $this->socialAction = $socialAction; + + return $this; + } + + public function getCreatedAt(): ?\DateTimeInterface + { + return $this->createdAt; + } + + public function setCreatedAt(\DateTimeInterface $createdAt): self + { + $this->createdAt = $createdAt; + + return $this; + } + + public function getCreatedBy(): ?User + { + return $this->createdBy; + } + + public function setCreatedBy(?User $createdBy): self + { + $this->createdBy = $createdBy; + + return $this; + } + + public function getStartDate(): ?\DateTimeInterface + { + return $this->startDate; + } + + public function setStartDate(\DateTimeInterface $startDate): self + { + $this->startDate = $startDate; + + return $this; + } + + public function getEndDate(): ?\DateTimeInterface + { + return $this->endDate; + } + + public function setEndDate(\DateTimeInterface $endDate): self + { + $this->endDate = $endDate; + + return $this; + } + + public function getHandlingThierParty(): ?ThirdParty + { + return $this->handlingThierParty; + } + + public function setHandlingThierParty(?ThirdParty $handlingThierParty): self + { + $this->handlingThierParty = $handlingThierParty; + + return $this; + } + + public function getCreatedAutomatically(): ?bool + { + return $this->createdAutomatically; + } + + public function setCreatedAutomatically(bool $createdAutomatically): self + { + $this->createdAutomatically = $createdAutomatically; + + return $this; + } + + public function getCreatedAutomaticallyReason(): ?string + { + return $this->createdAutomaticallyReason; + } + + public function setCreatedAutomaticallyReason(string $createdAutomaticallyReason): self + { + $this->createdAutomaticallyReason = $createdAutomaticallyReason; + + return $this; + } + + /** + * @return Collection|AccompanyingPeriodWorkGoal[] + */ + public function getGoals(): Collection + { + return $this->goals; + } + + public function addGoal(AccompanyingPeriodWorkGoal $goal): self + { + if (!$this->goals->contains($goal)) { + $this->goals[] = $goal; + $goal->setAccompanyingPeriodWork2($this); + } + + return $this; + } + + public function removeGoal(AccompanyingPeriodWorkGoal $goal): self + { + if ($this->goals->removeElement($goal)) { + // set the owning side to null (unless already changed) + if ($goal->getAccompanyingPeriodWork2() === $this) { + $goal->setAccompanyingPeriodWork2(null); + } + } + + return $this; + } + + /** + * @return Collection|Result[] + */ + public function getResults(): Collection + { + return $this->results; + } + + public function addResult(Result $result): self + { + if (!$this->results->contains($result)) { + $this->results[] = $result; + } + + return $this; + } + + public function removeResult(Result $result): self + { + $this->results->removeElement($result); + + return $this; + } + + /** + * @return Collection|ThirdParty[] + */ + public function getThirdParties(): Collection + { + return $this->thirdParties; + } + + public function addThirdParty(ThirdParty $thirdParty): self + { + if (!$this->thirdParties->contains($thirdParty)) { + $this->thirdParties[] = $thirdParty; + } + + return $this; + } + + public function removeThirdParty(ThirdParty $thirdParty): self + { + $this->thirdParties->removeElement($thirdParty); + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php new file mode 100644 index 000000000..406e99152 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php @@ -0,0 +1,115 @@ +results = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getNote(): ?string + { + return $this->note; + } + + public function setNote(string $note): self + { + $this->note = $note; + + return $this; + } + + public function getAccompanyingPeriodWork(): ?AccompanyingPeriodWork + { + return $this->accompanyingPeriodWork; + } + + public function setAccompanyingPeriodWork(?AccompanyingPeriodWork $accompanyingPeriodWork): self + { + $this->accompanyingPeriodWork = $accompanyingPeriodWork; + + return $this; + } + + public function getGoal(): ?Goal + { + return $this->goal; + } + + public function setGoal(?Goal $goal): self + { + $this->goal = $goal; + + return $this; + } + + /** + * @return Collection|Result[] + */ + public function getResults(): Collection + { + return $this->results; + } + + public function addResult(Result $result): self + { + if (!$this->results->contains($result)) { + $this->results[] = $result; + } + + return $this; + } + + public function removeResult(Result $result): self + { + $this->results->removeElement($result); + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php new file mode 100644 index 000000000..1fd6c8734 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php @@ -0,0 +1,93 @@ +id; + } + + public function getTitle(): array + { + return $this->title; + } + + public function setTitle(array $title): self + { + $this->title = $title; + + return $this; + } + + public function getDelay(): ?\DateInterval + { + return $this->delay; + } + + public function setDelay(\DateInterval $delay): self + { + $this->delay = $delay; + + return $this; + } + + public function getNotificationDelay(): ?\DateInterval + { + return $this->notificationDelay; + } + + public function setNotificationDelay(\DateInterval $notificationDelay): self + { + $this->notificationDelay = $notificationDelay; + + return $this; + } + + public function getSocialAction(): ?SocialAction + { + return $this->socialAction; + } + + public function setSocialAction(?SocialAction $socialAction): self + { + $this->socialAction = $socialAction; + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php index 3ffe9762e..5eb3224bc 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php @@ -2,6 +2,8 @@ namespace App\Entity\Chill\PersonBundle\Entity\SocialWork; +use App\Entity\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork; +use App\Entity\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkGoal; use App\Repository\Chill\PersonBundle\Entity\SocialWork\ResultRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; @@ -40,10 +42,22 @@ class Result */ private $goals; + /** + * @ORM\ManyToMany(targetEntity=AccompanyingPeriodWork::class, mappedBy="results") + */ + private $accompanyingPeriodWorks; + + /** + * @ORM\ManyToMany(targetEntity=AccompanyingPeriodWorkGoal::class, mappedBy="results") + */ + private $accompanyingPeriodWorkGoals; + public function __construct() { $this->socialActions = new ArrayCollection(); $this->goals = new ArrayCollection(); + $this->accompanyingPeriodWorks = new ArrayCollection(); + $this->accompanyingPeriodWorkGoals = new ArrayCollection(); } public function getId(): ?int @@ -122,4 +136,52 @@ class Result return $this; } + + /** + * @return Collection|AccompanyingPeriodWork[] + */ + public function getAccompanyingPeriodWorks(): Collection + { + return $this->accompanyingPeriodWorks; + } + + public function addAccompanyingPeriodWork(AccompanyingPeriodWork $accompanyingPeriod): self + { + if (!$this->accompanyingPeriodWorks->contains($accompanyingPeriod)) { + $this->accompanyingPeriodWorks[] = $accompanyingPeriod; + } + + return $this; + } + + public function removeAccompanyingPeriodWork(AccompanyingPeriodWork $accompanyingPeriod): self + { + $this->accompanyingPeriodWorks->removeElement($accompanyingPeriod); + + return $this; + } + + /** + * @return Collection|AccompanyingPeriodWorkGoal[] + */ + public function getAccompanyingPeriodWorkGoals(): Collection + { + return $this->accompanyingPeriodWorkGoals; + } + + public function addAccompanyingPeriodWorkGoal(AccompanyingPeriodWorkGoal $accompanyingPeriodWorkGoal): self + { + if (!$this->accompanyingPeriodWorkGoals->contains($accompanyingPeriodWorkGoal)) { + $this->accompanyingPeriodWorkGoals[] = $accompanyingPeriodWorkGoal; + } + + return $this; + } + + public function removeAccompanyingPeriodWorkGoal(AccompanyingPeriodWorkGoal $accompanyingPeriodWorkGoal): self + { + $this->accompanyingPeriodWorkGoals->removeElement($accompanyingPeriodWorkGoal); + + return $this; + } } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php new file mode 100644 index 000000000..52119cc55 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php @@ -0,0 +1,21 @@ +