public function run($query)
    {
        $options = $this->options;
        if ($this->hasActiveFilters()) {
            foreach ($options['params'] as $param => $value) {
                $query->where(
                    function ($query) use ($options, $param, $value) {
                        $options['filters'][$param]($query, $value);
                    }
                );
            }
        }
        //Setting data for filter form
        $this->options['params'] = $options['params'];

        if ($options['save']) {
            $_SESSION[$options['save']] = $options['params'];
        }
        return $query;
    }
public function run($query)
    {
        $options = $this->options;
        if ($this->hasActiveFilters()) {
            foreach ($options['params'] as $param => $value) {
                $query->where(
                    function ($query) use ($options, $param, $value) {
                        $options['filters'][$param]($query, $value);
                    }
                );
            }
        }
        //Setting data for filter form
        $this->options['params'] = $options['params'];

        if ($options['save']) {
            $_SESSION[$options['save']] = $options['params'];
        }
        return $query;
    }
public function run ( $ query ) { $ options = $ this -> options ; if ( $ this -> hasActiveFilters ( ) ) { foreach ( $ options [ 'params' ] as $ param => $ value ) { $ query -> where ( function ( $ query ) use ( $ options , $ param , $ value ) { $ options [ 'filters' ] [ $ param ] ( $ query , $ value ) ; } ) ; } } //Setting data for filter form $ this -> options [ 'params' ] = $ options [ 'params' ] ; if ( $ options [ 'save' ] ) { $ _SESSION [ $ options [ 'save' ] ] = $ options [ 'params' ] ; } return $ query ; }
Apply filter on query

@param  \Globalis\PuppetSkilled\Database\Query\Builder|\Globalis\PuppetSkilled\Database\Magic\Builder $query
@return \Globalis\PuppetSkilled\Database\Query\Builder
Apply filter on query