improvement, but still not correct

This commit is contained in:
Julie Lenaerts 2022-03-16 11:55:19 +01:00
parent d81a41bb17
commit ea21f2d9c4

View File

@ -235,16 +235,14 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
if (count($descendants) > 0) { if (count($descendants) > 0) {
foreach ($descendants as $d) { foreach ($descendants as $d) {
$inCollection = $this->socialActions->contains($d); $inCollection = $this->socialActions->contains($d);
if ($inCollection) { if ($inCollection) {
return $this; return $this;
} }
} }
} else { }
if (!$this->socialActions->contains($socialAction)) { if (!$this->socialActions->contains($socialAction)) {
$this->socialActions[] = $socialAction; $this->socialActions[] = $socialAction;
} }
}
return $this; return $this;
} }
@ -256,16 +254,15 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
if (count($descendants) > 0) { if (count($descendants) > 0) {
foreach ($descendants as $d) { foreach ($descendants as $d) {
$inCollection = $this->socialIssues->contains($d); $inCollection = $this->socialIssues->contains($d);
if ($inCollection) { if ($inCollection) {
return $this; return $this;
} }
} }
} else { }
if (!$this->socialIssues->contains($socialIssue)) { if (!$this->socialIssues->contains($socialIssue)) {
$this->socialIssues[] = $socialIssue; $this->socialIssues[] = $socialIssue;
} }
}
return $this; return $this;
} }