src/Database/Migration/Generator/MySqlGenerator.php
public function getColumnLimit($columnData)
    {
        $limit = 0;
        $type = $this->getMySQLColumnType($columnData);
        switch ($type) {
            case 'int':
                $limit = 'MysqlAdapter::INT_REGULAR';
                break;
            case 'tinyint':
                $limit = 'MysqlAdapter::INT_TINY';
                break;
            case 'smallint':
                $limit = 'MysqlAdapter::INT_SMALL';
                break;
            case 'mediumint':
                $limit = 'MysqlAdapter::INT_MEDIUM';
                break;
            case 'bigint':
                $limit = 'MysqlAdapter::INT_BIG';
                break;
            case 'tinytext':
                $limit = 'MysqlAdapter::TEXT_TINY';
                break;
            case 'mediumtext':
                $limit = 'MysqlAdapter::TEXT_MEDIUM';
                break;
            case 'longtext':
                $limit = 'MysqlAdapter::TEXT_LONG';
                break;
            case 'longblob':
                $limit = 'MysqlAdapter::BLOB_LONG';
                break;
            case 'mediumblob':
                $limit = 'MysqlAdapter::BLOB_MEDIUM';
                break;
            case 'blob':
                $limit = 'MysqlAdapter::BLOB_REGULAR';
                break;
            case 'tinyblob':
                $limit = 'MysqlAdapter::BLOB_TINY';
                break;
            default:
                if (!empty($columnData['CHARACTER_MAXIMUM_LENGTH'])) {
                    $limit = $columnData['CHARACTER_MAXIMUM_LENGTH'];
                } else {
                    $pattern = '/\((\d+)\)/';
                    if (preg_match($pattern, $columnData['COLUMN_TYPE'], $match) === 1) {
                        $limit = $match[1];
                    }
                }
        }

        return $limit;
    }
public function getColumnLimit($columnData)
    {
        $limit = 0;
        $type = $this->getMySQLColumnType($columnData);
        switch ($type) {
            case 'int':
                $limit = 'MysqlAdapter::INT_REGULAR';
                break;
            case 'tinyint':
                $limit = 'MysqlAdapter::INT_TINY';
                break;
            case 'smallint':
                $limit = 'MysqlAdapter::INT_SMALL';
                break;
            case 'mediumint':
                $limit = 'MysqlAdapter::INT_MEDIUM';
                break;
            case 'bigint':
                $limit = 'MysqlAdapter::INT_BIG';
                break;
            case 'tinytext':
                $limit = 'MysqlAdapter::TEXT_TINY';
                break;
            case 'mediumtext':
                $limit = 'MysqlAdapter::TEXT_MEDIUM';
                break;
            case 'longtext':
                $limit = 'MysqlAdapter::TEXT_LONG';
                break;
            case 'longblob':
                $limit = 'MysqlAdapter::BLOB_LONG';
                break;
            case 'mediumblob':
                $limit = 'MysqlAdapter::BLOB_MEDIUM';
                break;
            case 'blob':
                $limit = 'MysqlAdapter::BLOB_REGULAR';
                break;
            case 'tinyblob':
                $limit = 'MysqlAdapter::BLOB_TINY';
                break;
            default:
                if (!empty($columnData['CHARACTER_MAXIMUM_LENGTH'])) {
                    $limit = $columnData['CHARACTER_MAXIMUM_LENGTH'];
                } else {
                    $pattern = '/\((\d+)\)/';
                    if (preg_match($pattern, $columnData['COLUMN_TYPE'], $match) === 1) {
                        $limit = $match[1];
                    }
                }
        }

        return $limit;
    }
public function getColumnLimit ( $ columnData ) { $ limit = 0 ; $ type = $ this -> getMySQLColumnType ( $ columnData ) ; switch ( $ type ) { case 'int' : $ limit = 'MysqlAdapter::INT_REGULAR' ; break ; case 'tinyint' : $ limit = 'MysqlAdapter::INT_TINY' ; break ; case 'smallint' : $ limit = 'MysqlAdapter::INT_SMALL' ; break ; case 'mediumint' : $ limit = 'MysqlAdapter::INT_MEDIUM' ; break ; case 'bigint' : $ limit = 'MysqlAdapter::INT_BIG' ; break ; case 'tinytext' : $ limit = 'MysqlAdapter::TEXT_TINY' ; break ; case 'mediumtext' : $ limit = 'MysqlAdapter::TEXT_MEDIUM' ; break ; case 'longtext' : $ limit = 'MysqlAdapter::TEXT_LONG' ; break ; case 'longblob' : $ limit = 'MysqlAdapter::BLOB_LONG' ; break ; case 'mediumblob' : $ limit = 'MysqlAdapter::BLOB_MEDIUM' ; break ; case 'blob' : $ limit = 'MysqlAdapter::BLOB_REGULAR' ; break ; case 'tinyblob' : $ limit = 'MysqlAdapter::BLOB_TINY' ; break ; default : if ( ! empty ( $ columnData [ 'CHARACTER_MAXIMUM_LENGTH' ] ) ) { $ limit = $ columnData [ 'CHARACTER_MAXIMUM_LENGTH' ] ; } else { $ pattern = '/\((\d+)\)/' ; if ( preg_match ( $ pattern , $ columnData [ 'COLUMN_TYPE' ] , $ match ) === 1 ) { $ limit = $ match [ 1 ] ; } } } return $ limit ; }
Generate column limit.

@param array $columnData

@return string
Generate column limit .