mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Descendants for socialActions & Issues
This commit is contained in:
@@ -824,20 +824,41 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* List of all the social actions of the accompanyingPeriod
|
||||
* i.e. social actions From social issues from the accompanyingPeriod
|
||||
* @return Collection|SocialIssues[] All social issues and their descendants
|
||||
*/
|
||||
public function getSocialActions(): Collection
|
||||
public function getRecursiveSocialIssues(): Collection
|
||||
{
|
||||
$ret = new ArrayCollection();
|
||||
$recursiveSocialIssues = new ArrayCollection();
|
||||
|
||||
$this->socialIssues->forAll(function($key, $socialIssue) use ($ret) {
|
||||
$socialIssue->getSocialActions()->forAll(function($key, $socialAction) use ($ret) {
|
||||
$ret->add($socialAction);
|
||||
});
|
||||
});
|
||||
foreach( $this->socialIssues as $socialIssue) {
|
||||
foreach ($socialIssue->getDescendantsWithThis() as $descendant) {
|
||||
if(! $recursiveSocialIssues->contains($descendant)) {
|
||||
$recursiveSocialIssues->add($descendant);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
return $recursiveSocialIssues;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Collection|SocialAction[] All the descendant social actions of all
|
||||
* the descendants of the entity
|
||||
*/
|
||||
public function getRecursiveSocialActions(): Collection
|
||||
{
|
||||
$recursiveSocialActions = new ArrayCollection();
|
||||
|
||||
foreach( $this->socialIssues as $socialIssue) {
|
||||
foreach ($socialIssue->getRecursiveSocialActions() as $descendant) {
|
||||
if(! $recursiveSocialActions->contains($descendant)) {
|
||||
$recursiveSocialActions->add($descendant);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $recursiveSocialActions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user