mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
accompanying period validation - on social issues suppression
This commit is contained in:
@@ -121,6 +121,27 @@ class SocialIssue
|
||||
return $ancestors;
|
||||
}
|
||||
|
||||
/**
|
||||
* get all the ancestors of the social issue
|
||||
*
|
||||
* @param bool $includeThis if the array in the result must include the present SocialIssue
|
||||
*/
|
||||
public function getAncestors(bool $includeThis = true): array
|
||||
{
|
||||
$ancestors = [];
|
||||
|
||||
if ($includeThis) {
|
||||
$ancestors[] = $this;
|
||||
}
|
||||
|
||||
$current = $this;
|
||||
while ($current->hasParent()) {
|
||||
$ancestors[] = $current = $current->getParent();
|
||||
}
|
||||
|
||||
return $ancestors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|self[]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user