Bolt\Storage\Mapping\MetadataDriver::getFieldTypeFor PHP Метод

getFieldTypeFor() публичный Метод

Get the field type for a given column.
public getFieldTypeFor ( string $name, Doctrine\DBAL\Schema\Column $column, null $field = null ) : string
$name string
$column Doctrine\DBAL\Schema\Column
$field null Optional field value for repeaters/array based columns
Результат string
    public function getFieldTypeFor($name, $column, $field = 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;
    }