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:
Sean Harvey 2012-06-12 14:21:59 +12:00
parent 59e68f16da
commit 0a2e877625

View File

@ -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) {