diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index f183ced60..db16ac9f6 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -235,15 +235,13 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac if (count($descendants) > 0) { foreach ($descendants as $d) { $inCollection = $this->socialActions->contains($d); - if ($inCollection) { return $this; } } - } else { - if (!$this->socialActions->contains($socialAction)) { - $this->socialActions[] = $socialAction; - } + } + if (!$this->socialActions->contains($socialAction)) { + $this->socialActions[] = $socialAction; } return $this; @@ -256,15 +254,14 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac if (count($descendants) > 0) { foreach ($descendants as $d) { $inCollection = $this->socialIssues->contains($d); - if ($inCollection) { return $this; } } - } else { - if (!$this->socialIssues->contains($socialIssue)) { - $this->socialIssues[] = $socialIssue; - } + } + + if (!$this->socialIssues->contains($socialIssue)) { + $this->socialIssues[] = $socialIssue; } return $this;