original_string: 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();
      }
code: 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();
      }
code_tokens: 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 ( ) ; }
docstring: Caches the annotation columns result into a file.
docstring_tokens: Caches the annotation columns result into a file .