mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 21:29:23 +02:00
MINOR Remove PostgreSQLDatabase boolean workaround in
DataObject::__construct() The database adapter uses smallint instead of the boolean datatype, which works around the issue instead of converting the value.
This commit is contained in:
parent
59e68f16da
commit
0a2e877625
@ -313,15 +313,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
$record = null;
|
$record = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert PostgreSQL boolean values
|
|
||||||
// TODO: Implement this more elegantly, for example by writing a more intelligent SQL SELECT query prior to object construction
|
|
||||||
if(DB::getConn() instanceof PostgreSQLDatabase) {
|
|
||||||
$this->class = get_class($this);
|
|
||||||
foreach($record as $k => $v) {
|
|
||||||
if($this->db($k) == 'Boolean' && $v == 'f') $record[$k] = '0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set $this->record to $record, but ignore NULLs
|
// Set $this->record to $record, but ignore NULLs
|
||||||
$this->record = array();
|
$this->record = array();
|
||||||
foreach($record as $k => $v) {
|
foreach($record as $k => $v) {
|
||||||
|
Loading…
Reference in New Issue
Block a user