silverstripe-framework/model/fieldtypes/Bigint.php
Loz Calver 40bf945322 NEW: PHP 7 compatibility
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
2017-04-05 11:00:04 +10:00

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);
}
}