protected function isColumnRelated($column, $multi = false)
    {
        if (!isset($column->relation) || $this->isColumnPivot($column)) {
            return false;
        }

        if (!$this->model->hasRelation($column->relation)) {
            throw new ApplicationException(Lang::get(
                'backend::lang.model.missing_relation',
                ['class'=>get_class($this->model), 'relation'=>$column->relation]
            ));
        }

        if (!$multi) {
            return true;
        }

        $relationType = $this->model->getRelationType($column->relation);

        return in_array($relationType, [
            'hasMany',
            'belongsToMany',
            'morphToMany',
            'morphedByMany',
            'morphMany',
            'attachMany',
            'hasManyThrough'
        ]);
    }
protected function isColumnRelated($column, $multi = false)
    {
        if (!isset($column->relation) || $this->isColumnPivot($column)) {
            return false;
        }

        if (!$this->model->hasRelation($column->relation)) {
            throw new ApplicationException(Lang::get(
                'backend::lang.model.missing_relation',
                ['class'=>get_class($this->model), 'relation'=>$column->relation]
            ));
        }

        if (!$multi) {
            return true;
        }

        $relationType = $this->model->getRelationType($column->relation);

        return in_array($relationType, [
            'hasMany',
            'belongsToMany',
            'morphToMany',
            'morphedByMany',
            'morphMany',
            'attachMany',
            'hasManyThrough'
        ]);
    }
protected function isColumnRelated ( $ column , $ multi = false ) { if ( ! isset ( $ column -> relation ) || $ this -> isColumnPivot ( $ column ) ) { return false ; } if ( ! $ this -> model -> hasRelation ( $ column -> relation ) ) { throw new ApplicationException ( Lang :: get ( 'backend::lang.model.missing_relation' , [ 'class' => get_class ( $ this -> model ) , 'relation' => $ column -> relation ] ) ) ; } if ( ! $ multi ) { return true ; } $ relationType = $ this -> model -> getRelationType ( $ column -> relation ) ; return in_array ( $ relationType , [ 'hasMany' , 'belongsToMany' , 'morphToMany' , 'morphedByMany' , 'morphMany' , 'attachMany' , 'hasManyThrough' ] ) ; }
Check if column refers to a relation of the model
@param  ListColumn  $column List column object
@param  boolean     $multi  If set, returns true only if the relation is a "multiple relation type"
@return boolean
Check if column refers to a relation of the model