mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Merge branch '111_exports_suite' into calendar/finalization
This commit is contained in:
@@ -228,6 +228,22 @@ class SocialAction
|
||||
return $descendants;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection|SocialAction[] $socialActions
|
||||
*/
|
||||
public static function getDescendantsWithThisForActions($socialActions): Collection
|
||||
{
|
||||
$unique = [];
|
||||
|
||||
foreach ($socialActions as $action) {
|
||||
foreach ($action->getDescendantsWithThis() as $child) {
|
||||
$unique[spl_object_hash($child)] = $child;
|
||||
}
|
||||
}
|
||||
|
||||
return new ArrayCollection(array_values($unique));
|
||||
}
|
||||
|
||||
public function getEvaluations(): Collection
|
||||
{
|
||||
return $this->evaluations;
|
||||
@@ -274,6 +290,11 @@ class SocialAction
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function hasChildren(): bool
|
||||
{
|
||||
return 0 < $this->getChildren()->count();
|
||||
}
|
||||
|
||||
public function hasParent(): bool
|
||||
{
|
||||
return $this->getParent() instanceof self;
|
||||
@@ -369,6 +390,8 @@ class SocialAction
|
||||
{
|
||||
$this->parent = $parent;
|
||||
|
||||
$parent->addChild($this);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user