protected static function findHierarchy($vid, $parentID = false)
    {
        if (! isset(static::$_hierarchy[$vid][$parentID])) {
            $condition = ['vid' => $vid];

            if (is_numeric($parentID)) {
                $condition['parent_id'] = $parentID;
            }

            static::$_hierarchy[$vid][$parentID] = (new Query)
                ->from(static::tableName())
                ->where($condition)
                ->all();
        }

        return static::$_hierarchy[$vid][$parentID];
    }