cvs: pear /DB_DataObject DataObject.php
| From: | Alan Knowles | Date: | Sat, 22 Jan 2005 02:37:02 +0000 |
| Subject: | cvs: pear /DB_DataObject DataObject.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-28733@lists.php.net to get a copy of this message | ||
alan_k Fri Jan 21 21:37:02 2005 EDT
Modified files:
/pear/DB_DataObject DataObject.php
Log:
fix bug #3264 - warning running joinAdd on an object with results.
http://cvs.php.net/diff.php/pear/DB_DataObject/DataObject.php?r1=1.310&r2=1.311&ty=u
Index: pear/DB_DataObject/DataObject.php
diff -u pear/DB_DataObject/DataObject.php:1.310 pear/DB_DataObject/DataObject.php:1.311
--- pear/DB_DataObject/DataObject.php:1.310 Mon Jan 17 20:31:17 2005
+++ pear/DB_DataObject/DataObject.php Fri Jan 21 21:37:02 2005
@@ -20,7 +20,7 @@
* @package DB_DataObject
* @category DB
*
- * $Id: DataObject.php,v 1.310 2005/01/18 01:31:17 alan_k Exp $
+ * $Id: DataObject.php,v 1.311 2005/01/22 02:37:02 alan_k Exp $
*/
/* ===========================================================================
@@ -2867,7 +2867,13 @@
/* this is probably an error condition! */
$this->whereAdd("{$joinAs}.{$kSql} = 0");
}
-
+ if (!isset($this->_query)) {
+ $this->raiseError(
+ "joinAdd can not be run from a object that has had a query run on it,
+ clone the object or create a new one and use setFrom()",
+ DB_DATAOBJECT_ERROR_INVALIDARGS);
+ return false;
+ }
// and finally merge the whereAdd from the child..
if (!$obj->_query['condition']) {
return true;