diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php index 5c05fe683..3324a236f 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php @@ -72,6 +72,9 @@ class Evaluation $this->socialActions = new ArrayCollection(); } + /** + * @internal do use @see{SocialAction::addEvaluation} + */ public function addSocialAction(SocialAction $socialAction): self { if (!$this->socialActions->contains($socialAction)) { @@ -111,6 +114,11 @@ class Evaluation return $this->url; } + /** + * @return $this + * + * @internal do use @see{SocialAction::removeEvaluation} + */ public function removeSocialAction(SocialAction $socialAction): self { if ($this->socialActions->contains($socialAction)) { diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php index bc81bc180..1607d385d 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php @@ -112,6 +112,7 @@ class SocialAction { if (!$this->evaluations->contains($evaluation)) { $this->evaluations[] = $evaluation; + $evaluation->addSocialAction($this); } return $this; @@ -310,6 +311,7 @@ class SocialAction public function removeEvaluation(Evaluation $evaluation): self { $this->evaluations->removeElement($evaluation); + $evaluation->removeSocialAction($this); return $this; } diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php index 54308bc9c..f1050b134 100644 --- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php @@ -193,7 +193,7 @@ final class SocialWorkMetadata implements SocialWorkMetadataInterface /** @var Evaluation $eval */ $eval = $this->getOrCreateEntity($this->evaluationRepository, 'title', ['fr' => $evaluationTitle]); $eval->setTitle(['fr' => $evaluationTitle]); - $eval->addSocialAction($socialAction); + $socialAction->addEvaluation($eval); $this->entityManager->persist($eval);