public getParents ( ) : |
||
return |
public function getParents()
{
if (!$this->parents) {
$this->parents = array();
if ($this->isNew()) {
return $this->parents ?: [];
}
$ancestors = $this->getAncestors();
foreach ($ancestors as $parent) {
if ($parent->getType() !== null && $parent->getType() < 2) {
//exclude root node
$this->parents[] = $parent;
}
}
}
return $this->parents;
}