src/Leevel/Tree/Tree.php
public function getParents($id, bool $withItSelf = false): array
    {
        $data = $this->getParentsReal($id);
        sort($data);

        if (true === $withItSelf) {
            $data[] = $id;
        }

        return $data;
    }
public function getParents($id, bool $withItSelf = false): array
    {
        $data = $this->getParentsReal($id);
        sort($data);

        if (true === $withItSelf) {
            $data[] = $id;
        }

        return $data;
    }
取得给定 ID 所有父级 ID.

@param int|string $id
@param bool       $withItSelf

@return array