You are here

public static function Utils::getMssqlType in Drupal driver for SQL Server and SQL Azure 4.0.x

Same name and namespace in other branches
  1. 4.2.x src/Driver/Database/sqlsrv/Utils.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Utils::getMssqlType()
  2. 3.1.x src/Driver/Database/sqlsrv/Utils.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Utils::getMssqlType()
  3. 4.1.x src/Driver/Database/sqlsrv/Utils.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Utils::getMssqlType()

Returns the spec for a MSSQL data type definition.

Parameters

string $type: Data type.

Return value

string Data type spec.

File

src/Driver/Database/sqlsrv/Utils.php, line 78

Class

Utils
Utility function for the SQL Server driver.

Namespace

Drupal\sqlsrv\Driver\Database\sqlsrv

Code

public static function getMssqlType($type) {
  $matches = [];
  if (preg_match('/^[a-zA-Z]*/', $type, $matches)) {
    return reset($matches);
  }
  return $type;
}