protected function populateAndCacheAnnotationColumns()
    {
        $gridAnnotations = $this->readGridAnnotations();
        $annotationColumns = $gridAnnotations['columns'];

        $sort = $gridAnnotations['sort'];
        if ($annotationColumns) {
            $output = "<?php\nreturn array('columns' => array(\n";
            foreach ($annotationColumns as $field => $info) {
                $class = $info['class'];
                $output .= "'$field' => new $class(";
                $first = true;
                foreach ($info['arguments'] as $argument) {
                    if ($first) {
                        $first = false;
                    } else {
                        $output .= ',';
                    }
                    $output .= var_export($argument, true);
                }
                $output .= '),';
            }
            $output .= "), 'sort' => array(";
            foreach ($sort as $key => $value) {
                $output .= "'$key'".' => ';
                if (null === $value) {
                    $output .= 'null,';
                } else {
                    $output .= "'$value',";
                }
            }
            $output .= "));\n";
        } else {
            $output = "<?php\nreturn false;\n";
        }
        file_put_contents($this->annotationCacheFilename, $output);
        $this->includeAnnotationCache();
    }
protected function populateAndCacheAnnotationColumns()
    {
        $gridAnnotations = $this->readGridAnnotations();
        $annotationColumns = $gridAnnotations['columns'];

        $sort = $gridAnnotations['sort'];
        if ($annotationColumns) {
            $output = "<?php\nreturn array('columns' => array(\n";
            foreach ($annotationColumns as $field => $info) {
                $class = $info['class'];
                $output .= "'$field' => new $class(";
                $first = true;
                foreach ($info['arguments'] as $argument) {
                    if ($first) {
                        $first = false;
                    } else {
                        $output .= ',';
                    }
                    $output .= var_export($argument, true);
                }
                $output .= '),';
            }
            $output .= "), 'sort' => array(";
            foreach ($sort as $key => $value) {
                $output .= "'$key'".' => ';
                if (null === $value) {
                    $output .= 'null,';
                } else {
                    $output .= "'$value',";
                }
            }
            $output .= "));\n";
        } else {
            $output = "<?php\nreturn false;\n";
        }
        file_put_contents($this->annotationCacheFilename, $output);
        $this->includeAnnotationCache();
    }
protected function populateAndCacheAnnotationColumns ( ) { $ gridAnnotations = $ this -> readGridAnnotations ( ) ; $ annotationColumns = $ gridAnnotations [ 'columns' ] ; $ sort = $ gridAnnotations [ 'sort' ] ; if ( $ annotationColumns ) { $ output = "<?php\nreturn array('columns' => array(\n" ; foreach ( $ annotationColumns as $ field => $ info ) { $ class = $ info [ 'class' ] ; $ output .= "'$field' => new $class(" ; $ first = true ; foreach ( $ info [ 'arguments' ] as $ argument ) { if ( $ first ) { $ first = false ; } else { $ output .= ',' ; } $ output .= var_export ( $ argument , true ) ; } $ output .= '),' ; } $ output .= "), 'sort' => array(" ; foreach ( $ sort as $ key => $ value ) { $ output .= "'$key'" . ' => ' ; if ( null === $ value ) { $ output .= 'null,' ; } else { $ output .= "'$value'," ; } } $ output .= "));\n" ; } else { $ output = "<?php\nreturn false;\n" ; } file_put_contents ( $ this -> annotationCacheFilename , $ output ) ; $ this -> includeAnnotationCache ( ) ; }
Caches the annotation columns result into a file.
Caches the annotation columns result into a file .