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];
    }
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];
    }
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 ] ; }
Get hierarchy IDS
@param int $vid
@param int|bool $parentID
@return array
Get hierarchy IDS