protected function processFilters($permanent = true)
    {
        foreach (($permanent ? $this->permanentFilters : $this->defaultFilters) as $columnId => $value) {
            /* @var $column Column */
            $column = $this->columns->getColumnById($columnId);

            if ($permanent) {
                // Disable the filter capability for the column
                $column->setFilterable(false);
            }

            // Convert simple value
            if (!is_array($value) || !is_string(key($value))) {
                $value = ['from' => $value];
            }

            // Convert boolean value
            if (isset($value['from']) && is_bool($value['from'])) {
                $value['from'] = $value['from'] ? '1' : '0';
            }

            // Convert simple value with select filter
            if ($column->getFilterType() === 'select') {
                if (isset($value['from']) && !is_array($value['from'])) {
                    $value['from'] = [$value['from']];
                }

                if (isset($value['to']) && !is_array($value['to'])) {
                    $value['to'] = [$value['to']];
                }
            }

            // Store in the session
            $this->set($columnId, $value);
        }
    }
protected function processFilters($permanent = true)
    {
        foreach (($permanent ? $this->permanentFilters : $this->defaultFilters) as $columnId => $value) {
            /* @var $column Column */
            $column = $this->columns->getColumnById($columnId);

            if ($permanent) {
                // Disable the filter capability for the column
                $column->setFilterable(false);
            }

            // Convert simple value
            if (!is_array($value) || !is_string(key($value))) {
                $value = ['from' => $value];
            }

            // Convert boolean value
            if (isset($value['from']) && is_bool($value['from'])) {
                $value['from'] = $value['from'] ? '1' : '0';
            }

            // Convert simple value with select filter
            if ($column->getFilterType() === 'select') {
                if (isset($value['from']) && !is_array($value['from'])) {
                    $value['from'] = [$value['from']];
                }

                if (isset($value['to']) && !is_array($value['to'])) {
                    $value['to'] = [$value['to']];
                }
            }

            // Store in the session
            $this->set($columnId, $value);
        }
    }
protected function processFilters ( $ permanent = true ) { foreach ( ( $ permanent ? $ this -> permanentFilters : $ this -> defaultFilters ) as $ columnId => $ value ) { /* @var $column Column */ $ column = $ this -> columns -> getColumnById ( $ columnId ) ; if ( $ permanent ) { // Disable the filter capability for the column $ column -> setFilterable ( false ) ; } // Convert simple value if ( ! is_array ( $ value ) || ! is_string ( key ( $ value ) ) ) { $ value = [ 'from' => $ value ] ; } // Convert boolean value if ( isset ( $ value [ 'from' ] ) && is_bool ( $ value [ 'from' ] ) ) { $ value [ 'from' ] = $ value [ 'from' ] ? '1' : '0' ; } // Convert simple value with select filter if ( $ column -> getFilterType ( ) === 'select' ) { if ( isset ( $ value [ 'from' ] ) && ! is_array ( $ value [ 'from' ] ) ) { $ value [ 'from' ] = [ $ value [ 'from' ] ] ; } if ( isset ( $ value [ 'to' ] ) && ! is_array ( $ value [ 'to' ] ) ) { $ value [ 'to' ] = [ $ value [ 'to' ] ] ; } } // Store in the session $ this -> set ( $ columnId , $ value ) ; } }
Store permanent filters to the session and disable the filter capability for the column if there are permanent filters.
Store permanent filters to the session and disable the filter capability for the column if there are permanent filters .