Jarves\Model\Node::getParents PHP Method

getParents() public method

Returns all parents. Mainly used for breadcrumb.
public getParents ( ) : Node[]
return Node[]
    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;
    }