original_string: protected function getReflectionColumns()
      {
          $metadata = $this->getClassMetadata();
          $fields = $metadata->getFieldNames();
          $identifier = $metadata->getIdentifier();
          $identifier = isset($identifier[0]) ? $identifier[0] : null;
  
          $columns = array();
          foreach ($fields as $field) {
              $mapping = $metadata->getFieldMapping($field);
              if (isset($mapping['options']) && isset($mapping['options']['label'])) {
                  $label = $mapping['options']['label'];
              } else {
                  $label = $this->fromCamelCase($field);
              }
  
              if ($identifier === $field) {
                  if (isset($mapping['strategy']) && 'auto' == $mapping['strategy']) {
                      continue;
                  }
              }
              $columns[$field] = new GridColumn($field, $label);
          }
  
          return $columns;
      }
code: protected function getReflectionColumns()
      {
          $metadata = $this->getClassMetadata();
          $fields = $metadata->getFieldNames();
          $identifier = $metadata->getIdentifier();
          $identifier = isset($identifier[0]) ? $identifier[0] : null;
  
          $columns = array();
          foreach ($fields as $field) {
              $mapping = $metadata->getFieldMapping($field);
              if (isset($mapping['options']) && isset($mapping['options']['label'])) {
                  $label = $mapping['options']['label'];
              } else {
                  $label = $this->fromCamelCase($field);
              }
  
              if ($identifier === $field) {
                  if (isset($mapping['strategy']) && 'auto' == $mapping['strategy']) {
                      continue;
                  }
              }
              $columns[$field] = new GridColumn($field, $label);
          }
  
          return $columns;
      }
code_tokens: protected function getReflectionColumns ( ) { $ metadata = $ this -> getClassMetadata ( ) ; $ fields = $ metadata -> getFieldNames ( ) ; $ identifier = $ metadata -> getIdentifier ( ) ; $ identifier = isset ( $ identifier [ 0 ] ) ? $ identifier [ 0 ] : null ; $ columns = array ( ) ; foreach ( $ fields as $ field ) { $ mapping = $ metadata -> getFieldMapping ( $ field ) ; if ( isset ( $ mapping [ 'options' ] ) && isset ( $ mapping [ 'options' ] [ 'label' ] ) ) { $ label = $ mapping [ 'options' ] [ 'label' ] ; } else { $ label = $ this -> fromCamelCase ( $ field ) ; } if ( $ identifier === $ field ) { if ( isset ( $ mapping [ 'strategy' ] ) && 'auto' == $ mapping [ 'strategy' ] ) { continue ; } } $ columns [ $ field ] = new GridColumn ( $ field , $ label ) ; } return $ columns ; }
docstring: Generate Columns based on document's Metadata.
docstring_tokens: Generate Columns based on document s Metadata .