From 0a2e87762538e64ae3f2973b2154f57a94ddffac Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 12 Jun 2012 14:21:59 +1200 Subject: [PATCH] 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. --- model/DataObject.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/model/DataObject.php b/model/DataObject.php index e0f01f077..a11f3c564 100644 --- a/model/DataObject.php +++ b/model/DataObject.php @@ -313,15 +313,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity $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 $this->record = array(); foreach($record as $k => $v) {