src/Charcoal/Object/HierarchicalTrait.php
public function hierarchy()
    {
        if (!isset($this->hierarchy)) {
            $hierarchy = [];
            $master = $this->master();
            while ($master) {
                $hierarchy[] = $master;
                $master = $master->master();
            }

            $this->hierarchy = $hierarchy;
        }

        return $this->hierarchy;
    }
public function hierarchy()
    {
        if (!isset($this->hierarchy)) {
            $hierarchy = [];
            $master = $this->master();
            while ($master) {
                $hierarchy[] = $master;
                $master = $master->master();
            }

            $this->hierarchy = $hierarchy;
        }

        return $this->hierarchy;
    }
Retrieve this object's ancestors (from immediate parent to top-level).

@return array