cvs: pear /DB_DataObject DataObject.php
| From: | Alan Knowles | Date: | Tue, 22 Feb 2005 05:23:07 +0000 |
| Subject: | cvs: pear /DB_DataObject DataObject.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-29652@lists.php.net to get a copy of this message | ||
alan_k Tue Feb 22 00:23:07 2005 EDT
Modified files:
/pear/DB_DataObject DataObject.php
Log:
cosmetic fixes + support for multidatabase joins. (Dmitry Nosovitsky)
http://cvs.php.net/diff.php/pear/DB_DataObject/DataObject.php?r1=1.324&r2=1.325&ty=u
Index: pear/DB_DataObject/DataObject.php
diff -u pear/DB_DataObject/DataObject.php:1.324 pear/DB_DataObject/DataObject.php:1.325
--- pear/DB_DataObject/DataObject.php:1.324 Thu Jan 27 08:41:09 2005
+++ pear/DB_DataObject/DataObject.php Tue Feb 22 00:23:07 2005
@@ -20,7 +20,7 @@
* @package DB_DataObject
* @category DB
*
- * $Id: DataObject.php,v 1.324 2005/01/27 13:41:09 alan_k Exp $
+ * $Id: DataObject.php,v 1.325 2005/02/22 05:23:07 alan_k Exp $
*/
/* ===========================================================================
@@ -384,8 +384,8 @@
$this->debug($n, "__find",1);
}
if (!$this->__table) {
- echo "NO \$__table SPECIFIED in class definition";
- exit;
+ // xdebug can backtrace this!
+ php_error("NO \$__table SPECIFIED in class definition",E_USER_ERROR);
}
$this->N = 0;
$query_before = $this->_query;
@@ -843,10 +843,11 @@
$_DB_DATAOBJECT['INI'][$this->_database][$this->__table] :
$this->table();
if (!$items) {
- $this->raiseError("insert:No table definition for {$this->__table}",
DB_DATAOBJECT_ERROR_INVALIDCONFIG);
+ $this->raiseError("insert:No table definition for {$this->__table}",
+ DB_DATAOBJECT_ERROR_INVALIDCONFIG);
return false;
}
- $options= &$_DB_DATAOBJECT['CONFIG'];
+ $options = &$_DB_DATAOBJECT['CONFIG'];
$datasaved = 1;
@@ -945,6 +946,8 @@
}
+ // not sure why we let empty insert here.. - I guess to generate a blank row..
+
if ($leftq || $useNative) {
$table = ($quoteIdentifiers ? $DB->quoteIdentifier($this->__table) :
$this->__table);
@@ -2811,8 +2814,11 @@
$quoteIdentifiers =
!empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers']);
- $objTable = $quoteIdentifiers ? $DB->quoteIdentifier($obj->__table) :
$obj->__table ;
-
+ // not sure how portable adding database prefixes is..
+ $objTable = $quoteIdentifiers ?
+ $DB->quoteIdentifier($obj->_database . '.' . $obj->__table) :
+ $obj->_database . '.' . $obj->__table ;
+
// add database prefix if they are different databases
if (($obj->_database != $this->_database) && strlen($obj->_database )) {
$objTable = ($quoteIdentifiers ? $DB->quoteIdentifier($obj->_database) :
$obj->_database) . '.' . $objTable;