public function getFieldTypeFor($name, $column, $field = null)
    {
        $type = null;
        if ($column instanceof Column) {
            if ($column->getType()) {
                $type = get_class($column->getType());
            }
            $column = $column->getName();
        }
        if ($field !== null) {
            if (isset($this->contenttypes[$name]) && isset($this->contenttypes[$name]['fields'][$column]['fields'][$field])) {
                $type = $this->contenttypes[$name]['fields'][$column]['fields'][$field]['type'];
            }
        } elseif (isset($this->contenttypes[$name]) && isset($this->contenttypes[$name]['fields'][$column])) {
            $type = $this->contenttypes[$name]['fields'][$column]['type'];
        }

        if ($column === 'slug') {
            $type = 'slug';
        }

        if ($type === 'select' && isset($this->contenttypes[$name]['fields'][$column]['multiple']) && $this->contenttypes[$name]['fields'][$column]['multiple'] === true) {
            $type = 'selectmultiple';
        }

        if ($type && isset($this->typemap[$type])) {
            $type = $this->typemap[$type];
        } else {
            $type = $this->typemap['text'];
        }

        return $type;
    }
public function getFieldTypeFor($name, $column, $field = null)
    {
        $type = null;
        if ($column instanceof Column) {
            if ($column->getType()) {
                $type = get_class($column->getType());
            }
            $column = $column->getName();
        }
        if ($field !== null) {
            if (isset($this->contenttypes[$name]) && isset($this->contenttypes[$name]['fields'][$column]['fields'][$field])) {
                $type = $this->contenttypes[$name]['fields'][$column]['fields'][$field]['type'];
            }
        } elseif (isset($this->contenttypes[$name]) && isset($this->contenttypes[$name]['fields'][$column])) {
            $type = $this->contenttypes[$name]['fields'][$column]['type'];
        }

        if ($column === 'slug') {
            $type = 'slug';
        }

        if ($type === 'select' && isset($this->contenttypes[$name]['fields'][$column]['multiple']) && $this->contenttypes[$name]['fields'][$column]['multiple'] === true) {
            $type = 'selectmultiple';
        }

        if ($type && isset($this->typemap[$type])) {
            $type = $this->typemap[$type];
        } else {
            $type = $this->typemap['text'];
        }

        return $type;
    }
public function getFieldTypeFor ( $ name , $ column , $ field = null ) { $ type = null ; if ( $ column instanceof Column ) { if ( $ column -> getType ( ) ) { $ type = get_class ( $ column -> getType ( ) ) ; } $ column = $ column -> getName ( ) ; } if ( $ field !== null ) { if ( isset ( $ this -> contenttypes [ $ name ] ) && isset ( $ this -> contenttypes [ $ name ] [ 'fields' ] [ $ column ] [ 'fields' ] [ $ field ] ) ) { $ type = $ this -> contenttypes [ $ name ] [ 'fields' ] [ $ column ] [ 'fields' ] [ $ field ] [ 'type' ] ; } } elseif ( isset ( $ this -> contenttypes [ $ name ] ) && isset ( $ this -> contenttypes [ $ name ] [ 'fields' ] [ $ column ] ) ) { $ type = $ this -> contenttypes [ $ name ] [ 'fields' ] [ $ column ] [ 'type' ] ; } if ( $ column === 'slug' ) { $ type = 'slug' ; } if ( $ type === 'select' && isset ( $ this -> contenttypes [ $ name ] [ 'fields' ] [ $ column ] [ 'multiple' ] ) && $ this -> contenttypes [ $ name ] [ 'fields' ] [ $ column ] [ 'multiple' ] === true ) { $ type = 'selectmultiple' ; } if ( $ type && isset ( $ this -> typemap [ $ type ] ) ) { $ type = $ this -> typemap [ $ type ] ; } else { $ type = $ this -> typemap [ 'text' ] ; } return $ type ; }
Get the field type for a given column.

@param string                       $name
@param \Doctrine\DBAL\Schema\Column $column
@param null                         $field  Optional field value for repeaters/array based columns

@return string
Get the field type for a given column .