private static function buildGridColumns($builder, $result, $classes)
    {
        $columns = $result->columns;
        $sizes   = deserialize($result->sizes, true);

        for ($i = 0; $i < $columns; $i++) {
            $column = $builder->addColumn();

            foreach ($sizes as $size) {
                $key    = 'columnset_' . $size;
                $values = deserialize($result->$key, true);

                $column->forDevice(
                    $size,
                    $values[$i]['width'],
                    ($values[$i]['offset']) ? ($values[$i]['offset'] == 'null' ? 0 : $values[$i]['offset']): null,
                    $values[$i]['order'] ?: null
                );

                $index = ($i + 1);

                if (!empty($classes[$index])) {
                    $column->setClass($classes[$index]);
                }
            }
        }

        return $builder->build();
    }
private static function buildGridColumns($builder, $result, $classes)
    {
        $columns = $result->columns;
        $sizes   = deserialize($result->sizes, true);

        for ($i = 0; $i < $columns; $i++) {
            $column = $builder->addColumn();

            foreach ($sizes as $size) {
                $key    = 'columnset_' . $size;
                $values = deserialize($result->$key, true);

                $column->forDevice(
                    $size,
                    $values[$i]['width'],
                    ($values[$i]['offset']) ? ($values[$i]['offset'] == 'null' ? 0 : $values[$i]['offset']): null,
                    $values[$i]['order'] ?: null
                );

                $index = ($i + 1);

                if (!empty($classes[$index])) {
                    $column->setClass($classes[$index]);
                }
            }
        }

        return $builder->build();
    }
private static function buildGridColumns ( $ builder , $ result , $ classes ) { $ columns = $ result -> columns ; $ sizes = deserialize ( $ result -> sizes , true ) ; for ( $ i = 0 ; $ i < $ columns ; $ i ++ ) { $ column = $ builder -> addColumn ( ) ; foreach ( $ sizes as $ size ) { $ key = 'columnset_' . $ size ; $ values = deserialize ( $ result -> $ key , true ) ; $ column -> forDevice ( $ size , $ values [ $ i ] [ 'width' ] , ( $ values [ $ i ] [ 'offset' ] ) ? ( $ values [ $ i ] [ 'offset' ] == 'null' ? 0 : $ values [ $ i ] [ 'offset' ] ) : null , $ values [ $ i ] [ 'order' ] ? : null ) ; $ index = ( $ i + 1 ) ; if ( ! empty ( $ classes [ $ index ] ) ) { $ column -> setClass ( $ classes [ $ index ] ) ; } } } return $ builder -> build ( ) ; }
Build columns.

@param GridBuilder      $builder The grid builder.
@param \Database\Result $result  The database result.
@param array            $classes Custom css classes.

@return Grid
Build columns .