cvs: pear /DB_DataObject DataObject.php
| From: | Alan Knowles | Date: | Sat, 12 Mar 2005 03:45:32 +0000 |
| Subject: | cvs: pear /DB_DataObject DataObject.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-30232@lists.php.net to get a copy of this message | ||
alan_k Fri Mar 11 22:45:32 2005 EDT
Modified files:
/pear/DB_DataObject DataObject.php
Log:
fix bug #3764 PostgreSQL Boolean Doesnt Work (lets see how much code that breaks!)
http://cvs.php.net/diff.php/pear/DB_DataObject/DataObject.php?r1=1.335&r2=1.336&ty=u
Index: pear/DB_DataObject/DataObject.php
diff -u pear/DB_DataObject/DataObject.php:1.335 pear/DB_DataObject/DataObject.php:1.336
--- pear/DB_DataObject/DataObject.php:1.335 Fri Mar 11 22:28:20 2005
+++ pear/DB_DataObject/DataObject.php Fri Mar 11 22:45:31 2005
@@ -20,7 +20,7 @@
* @package DB_DataObject
* @category DB
*
- * $Id: DataObject.php,v 1.335 2005/03/12 03:28:20 alan_k Exp $
+ * $Id: DataObject.php,v 1.336 2005/03/12 03:45:31 alan_k Exp $
*/
/* ===========================================================================
@@ -519,7 +519,7 @@
foreach($array as $k=>$v) {
$kk = str_replace(".", "_", $k);
$kk = str_replace(" ", "_", $kk);
- if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
+ if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("$kk = ". $array[$k], "fetchrow LINE", 3);
}
$this->$kk = $array[$k];
@@ -3483,8 +3483,16 @@
$x = new Date($this->$col);
return $x->format($format);
+
+ case ($cols[$col] & DB_DATAOBJECT_BOOLEAN):
+
+ if ($cols[$col] && DB_DATAOBJECT_STR) {
+ // it's a 't'/'f' !
+ return ($cols[$col] = 't');
+ }
+ return (bool) $cols[$col];
-
+
default:
return sprintf($format,$this->col);
}