mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-18 15:36:30 +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
26 lines
650 B
PHP
26 lines
650 B
PHP
<?php
|
|
|
|
/**
|
|
* Represents a signed 8 byte integer field. Do note PHP running as 32-bit might not work with Bigint properly, as it
|
|
* would convert the value to a float when queried from the database since the value is a 64-bit one.
|
|
*
|
|
* @package framework
|
|
* @subpackage model
|
|
* @see Int
|
|
*/
|
|
class BigInt extends DBInt {
|
|
|
|
public function requireField() {
|
|
$parts = array(
|
|
'datatype' => 'bigint',
|
|
'precision' => 8,
|
|
'null' => 'not null',
|
|
'default' => $this->defaultVal,
|
|
'arrayValue' => $this->arrayValue
|
|
);
|
|
|
|
$values = array('type' => 'bigint', 'parts' => $parts);
|
|
DB::require_field($this->tableName, $this->name, $values);
|
|
}
|
|
}
|