mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-08 18:51:12 +02:00
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);
|
|
}
|
|
}
|