public function parentRelations(array $relations): ModelList
    {
        $this->main['parents'] = [];

        foreach ($relations as $key => $value) {

            if (is_string($key)) {
                $parent = [
                    'relation' => $key,
                    'field'    => $value,
                ];
            } else {
                $parent = [
                    'relation' => $value,
                    'field'    => $value,
                ];
            }

            $this->main['parents'][] = $parent;
        }

        return $this;
    }
public function parentRelations(array $relations): ModelList
    {
        $this->main['parents'] = [];

        foreach ($relations as $key => $value) {

            if (is_string($key)) {
                $parent = [
                    'relation' => $key,
                    'field'    => $value,
                ];
            } else {
                $parent = [
                    'relation' => $value,
                    'field'    => $value,
                ];
            }

            $this->main['parents'][] = $parent;
        }

        return $this;
    }
public function parentRelations ( array $ relations ) : ModelList { $ this -> main [ 'parents' ] = [ ] ; foreach ( $ relations as $ key => $ value ) { if ( is_string ( $ key ) ) { $ parent = [ 'relation' => $ key , 'field' => $ value , ] ; } else { $ parent = [ 'relation' => $ value , 'field' => $ value , ] ; } $ this -> main [ 'parents' ] [ ] = $ parent ; } return $ this ; }
List parents for list hierarchy handling

The relations by which this listing may be 'filtered'.

@param string[] $relations  either relation names, or key-value pairs: relation => field
@return ModelList|$this
List parents for list hierarchy handling