Skip to content
This repository
Browse code

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.
  • Loading branch information...
commit 0a2e87762538e64ae3f2973b2154f57a94ddffac 1 parent 59e68f1
Sean Harvey authored June 12, 2012

Showing 1 changed file with 0 additions and 9 deletions. Show diff stats Hide diff stats

  1. 9  model/DataObject.php
9  model/DataObject.php
@@ -313,15 +313,6 @@ function __construct($record = null, $isSingleton = false, $model = null) {
313 313
 			$record = null;
314 314
 		}
315 315
 
316  
-		// Convert PostgreSQL boolean values
317  
-		// TODO: Implement this more elegantly, for example by writing a more intelligent SQL SELECT query prior to object construction
318  
-		if(DB::getConn() instanceof PostgreSQLDatabase) {
319  
-			$this->class = get_class($this);
320  
-			foreach($record as $k => $v) {
321  
-				if($this->db($k) == 'Boolean' && $v == 'f') $record[$k] = '0';
322  
-			}
323  
-		}
324  
-
325 316
 		// Set $this->record to $record, but ignore NULLs
326 317
 		$this->record = array();
327 318
 		foreach($record as $k => $v) {

0 notes on commit 0a2e877

Please sign in to comment.
Something went wrong with that request. Please try again.