admin: fix adding of evaluation to social action

This commit is contained in:
nobohan 2022-05-25 11:46:03 +02:00
parent bc410b02e7
commit 2ac78a12db

View File

@ -46,10 +46,8 @@ class SocialAction
private $desactivationDate;
/**
* @ORM\ManyToMany(
* targetEntity=Evaluation::class,
* mappedBy="socialActions"
* )
* @ORM\ManyToMany(targetEntity=Evaluation::class, inversedBy="socialActions")
* @ORM\JoinTable(name="chill_person_social_work_evaluation_action")
*/
private Collection $evaluations;
@ -110,6 +108,15 @@ class SocialAction
return $this;
}
public function addEvaluation(Evaluation $evaluation): self
{
if (!$this->evaluations->contains($evaluation)) {
$this->evaluations[] = $evaluation;
}
return $this;
}
public function addGoal(Goal $goal): self
{
if (!$this->goals->contains($goal)) {
@ -300,6 +307,13 @@ class SocialAction
return $this;
}
public function removeEvaluation(Evaluation $evaluation): self
{
$this->evaluations->removeElement($evaluation);
return $this;
}
public function removeGoal(Goal $goal): self
{
$this->goals->removeElement($goal);