return $this->group_name;
}
+ /**
+ * Get parents as an array
+ *
+ * @return array
+ */
+ public function getParents(): array
+ {
+ $parents = [];
+ $group = $this;
+ while ($group = $group->getParentGroup()) {
+ $parents[] = $group->getName();
+ }
+ return $parents;
+ }
+
+
/**
* Get the indented short name of the group " >> bar"
*
/**
* Get parent group
*
- * @return Group
+ * @return Group|null
*/
public function getParentGroup()
{
}
} while ($group = $group->getParentGroup());
- //@phpstan-ignore-next-line
return true;
}