cvs: pear /Tree Memory.php
| From: | Wolfram Kriesing | Date: | Sun, 02 Jun 2002 18:01:26 +0000 |
| Subject: | cvs: pear /Tree Memory.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4376@lists.php.net to get a copy of this message | ||
cain Sun Jun 2 14:01:26 2002 EDT
Modified files:
/pear/Tree Memory.php
Log:
- enable getElementContent to be able to use a path too
Index: pear/Tree/Memory.php
diff -u pear/Tree/Memory.php:1.8 pear/Tree/Memory.php:1.9
--- pear/Tree/Memory.php:1.8 Sat May 4 15:20:59 2002
+++ pear/Tree/Memory.php Sun Jun 2 14:01:26 2002
@@ -16,7 +16,7 @@
// | Authors: Wolfram Kriesing <wolfram@kriesing.de> |
// +----------------------------------------------------------------------+
//
-// $Id: Memory.php,v 1.8 2002/05/04 19:20:59 cain Exp $
+// $Id: Memory.php,v 1.9 2002/06/02 18:01:26 cain Exp $
require_once('Tree/Common.php');
require_once('Tree/Error.php');
@@ -788,11 +788,16 @@
* @version 2002/02/06
* @access private
* @author Wolfram Kriesing <wolfram@kriesing.de>
- * @param
+ * @param mixed either the id of an element or the path to the element
*
*/
- function getElementContent( $id , $fieldName )
+ function getElementContent( $idOrPath , $fieldName )
{
+ if( is_string($idOrPath) )
+ {
+ $id = $this->getIdByPath($idOrPath);
+ }
+
return $this->data[$id][$fieldName];
}