mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-18 07:26:40 +02:00
40bf945322
This patch introduces PHP 7 compatability without breaking semver by adding DBInt and DBFloat classes, with Int/Float classes that are only loaded into PHP 5 environments
19 lines
450 B
PHP
19 lines
450 B
PHP
<?php
|
|
/**
|
|
*
|
|
* @package framework
|
|
* @subpackage model
|
|
*/
|
|
class Double extends DBFloat {
|
|
|
|
public function requireField() {
|
|
// HACK: MSSQL does not support double so we're using float instead
|
|
// @todo This should go into MSSQLDatabase ideally somehow
|
|
if(DB::get_conn() instanceof MySQLDatabase) {
|
|
DB::require_field($this->tableName, $this->name, "double");
|
|
} else {
|
|
DB::require_field($this->tableName, $this->name, "float");
|
|
}
|
|
}
|
|
}
|