cvs: pear /DB_DBA DBA_Simple.php DBA_Table.php
| From: | Brent Cook | Date: | Wed, 10 Jul 2002 17:56:43 +0000 |
| Subject: | cvs: pear /DB_DBA DBA_Simple.php DBA_Table.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5020@lists.php.net to get a copy of this message | ||
busterb Wed Jul 10 13:56:43 2002 EDT
Modified files:
/pear/DB_DBA DBA_Simple.php DBA_Table.php
Log:
changed remove() and replace(); now they work like select(). removeKey() and
replaceKey() take their place.
Index: pear/DB_DBA/DBA_Simple.php
diff -u pear/DB_DBA/DBA_Simple.php:1.19 pear/DB_DBA/DBA_Simple.php:1.20
--- pear/DB_DBA/DBA_Simple.php:1.19 Mon Jul 8 13:15:59 2002
+++ pear/DB_DBA/DBA_Simple.php Wed Jul 10 13:56:42 2002
@@ -18,7 +18,7 @@
// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA|
// +----------------------------------------------------------------------+
//
-// $Id: DBA_Simple.php,v 1.19 2002/07/08 17:15:59 busterb Exp $
+// $Id: DBA_Simple.php,v 1.20 2002/07/10 17:56:42 busterb Exp $
require_once 'PEAR.php';
@@ -370,6 +370,21 @@
return key($this->_usedBlocks);
} else {
return false;
+ }
+ }
+
+ /**
+ * Returns all of the keys in the database
+ *
+ * @access public
+ * @return array key values
+ */
+ function fetchkeys()
+ {
+ if (is_array($this->_usedBlocks)) {
+ return array_keys($this->_usedBlocks);
+ } else {
+ return array();
}
}
Index: pear/DB_DBA/DBA_Table.php
diff -u pear/DB_DBA/DBA_Table.php:1.35 pear/DB_DBA/DBA_Table.php:1.36
--- pear/DB_DBA/DBA_Table.php:1.35 Mon Jul 8 13:15:59 2002
+++ pear/DB_DBA/DBA_Table.php Wed Jul 10 13:56:42 2002
@@ -18,7 +18,7 @@
// | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA|
// +----------------------------------------------------------------------+
//
-// $Id: DBA_Table.php,v 1.35 2002/07/08 17:15:59 busterb Exp $
+// $Id: DBA_Table.php,v 1.36 2002/07/10 17:56:42 busterb Exp $
//
require_once 'PEAR.php';
require_once 'DB/DBA/DBA.php';
@@ -706,7 +706,7 @@
* @param array $data assoc array or ordered list of data to insert
* @return mixed PEAR_Error on failure, the row index on success
*/
- function replace($key, $data)
+ function replaceKey($key, $data)
{
if ($this->isOpen()) {
return $this->_dba->replace($key, $this->_packRow($data));
@@ -716,17 +716,27 @@
}
/**
- * Removes an existing row in a table
+ * Removes an existing row in a table by row key
*
* @access public
* @param string $key row id to remove
* @return object PEAR_Error on failure
*/
- function remove($key)
+ function removeKey($key)
{
return $this->_dba->remove($key);
}
+ function remove($rawQuery, $rows=null)
+ {
+
+ }
+
+ function replace($rawQuery, $rows=null)
+ {
+
+ }
+
/**
* Fetches an existing row from a table
*
@@ -841,6 +851,11 @@
return $this->raiseError('DBA: table not open');
}
return $rows;
+ }
+
+ function getKeys()
+ {
+ return $this->_dba->fetchkeys();
}
/**