mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fixed reading of booleans in postgres
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66432 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
93438e0be2
commit
09e3145921
@ -129,6 +129,15 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
|
|||||||
$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';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->record = $this->original = $record;
|
$this->record = $this->original = $record;
|
||||||
|
|
||||||
// Keep track of the modification date of all the data sourced to make this page
|
// Keep track of the modification date of all the data sourced to make this page
|
||||||
|
Loading…
Reference in New Issue
Block a user