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;
    }
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;
    }
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 ; }
Generate Columns based on document's Metadata.
Generate Columns based on document s Metadata .