public function parentRelationActiveByDefault(string $relation): ModelList
    {
        $this->main['default_top_relation'] = $relation;

        if ( ! array_get($this->main, 'parents')) {
            // Assume the relation (= the field) if no parents set yet.

            $this->main['parents'] = [
                [
                    'relation' => $relation,
                    'field'    => $relation,
                ],
            ];
        }

        return $this;
    }
public function parentRelationActiveByDefault(string $relation): ModelList
    {
        $this->main['default_top_relation'] = $relation;

        if ( ! array_get($this->main, 'parents')) {
            // Assume the relation (= the field) if no parents set yet.

            $this->main['parents'] = [
                [
                    'relation' => $relation,
                    'field'    => $relation,
                ],
            ];
        }

        return $this;
    }
public function parentRelationActiveByDefault ( string $ relation ) : ModelList { $ this -> main [ 'default_top_relation' ] = $ relation ; if ( ! array_get ( $ this -> main , 'parents' ) ) { // Assume the relation (= the field) if no parents set yet. $ this -> main [ 'parents' ] = [ [ 'relation' => $ relation , 'field' => $ relation , ] , ] ; } return $ this ; }
Hide everything but top-level list parents by default to this relation

Useful to remove clutter for nested content with a click-through-to-children setup.
Set to relation method name that must be present in 'parents'.

@param string $relation
@return ModelList|$this
Hide everything but top - level list parents by default to this relation