N98\Magento\Command\Developer\Code\Model\MethodCommand::getColumnType PHP Method

getColumnType() protected method

Mapping method to transform MySQL column types into PHP types
protected getColumnType ( $columnType ) : string
$columnType
return string
    protected function getColumnType($columnType)
    {
        $cte = explode('(', $columnType);
        $columnType = strtolower($cte[0]);
        $typeMapper = array('int' => 'int', 'tinyint' => 'int', 'smallint' => 'int', 'decimal' => 'float', 'float' => 'float', 'double' => 'float', 'real' => 'float', 'char' => 'string', 'varchar' => 'string', 'text' => 'string', 'tinytext' => 'string', 'mediumtext' => 'string', 'longtext' => 'string', 'date' => 'string', 'datetime' => 'string', 'timestamp' => 'string');
        return isset($typeMapper[$columnType]) ? $typeMapper[$columnType] : '';
    }