Re: [Patch] Null values are replaced by o (zero) on joins

From: Date: Mon, 23 Jan 2006 02:18:32 +0000
Subject: Re: [Patch] Null values are replaced by o (zero) on joins
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-41037@lists.php.net to get a copy of this message
                $this->whereAdd("{$joinAs}.{$kSql} = {$obj->$k}");
                continue;
            }
+            +            if (is_a($obj->$k,'DB_DataObject_Cast')) {
+                $value = $obj->$k->toString($v,$DB);
+                if (PEAR::isError($value)) {
+                    $this->raiseError($value->getMessage() ,DB_DATAOBJECT_ERROR_INVALIDARG);
+                    return false;
+                }
+                if (strtolower($value) === 'null') {
+                    $obj->$k = 'null';
 
I've changed this to
$this->whereAdd("{$joinAs}.{$kSql} IS NULL"); as I suspect that is what it was supposed to be.. Regards Alan
+                } else {
+                    $this->whereAdd("{$joinAs}.{$kSql} = $value");
+                    continue;
+                }
+            }
+                        /* this is probably an error condition! */
            $this->whereAdd("{$joinAs}.{$kSql} = 0");
        }
 


« previous php.pear.dev (#41037) next »