cvs: pear /Tree Memory.php
| From: | Wolfram Kriesing | Date: | Fri, 23 Aug 2002 17:20:00 +0000 |
| Subject: | cvs: pear /Tree Memory.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5913@lists.php.net to get a copy of this message | ||
cain Fri Aug 23 13:20:00 2002 EDT
Modified files:
/pear/Tree Memory.php
Log:
- throw error in remove on failure
- call source class's copy method, that works at least in with the Filesystem
Index: pear/Tree/Memory.php
diff -u pear/Tree/Memory.php:1.11 pear/Tree/Memory.php:1.12
--- pear/Tree/Memory.php:1.11 Fri Jul 26 06:36:33 2002
+++ pear/Tree/Memory.php Fri Aug 23 13:20:00 2002
@@ -16,7 +16,7 @@
// | Authors: Wolfram Kriesing <wolfram@kriesing.de> |
// +----------------------------------------------------------------------+
//
-// $Id: Memory.php,v 1.11 2002/07/26 10:36:33 cain Exp $
+// $Id: Memory.php,v 1.12 2002/08/23 17:20:00 cain Exp $
require_once('Tree/Common.php');
require_once('Tree/Error.php');
@@ -403,7 +403,7 @@
if( isset( $this->data[$id]['child'] ) )
{
# TODO raise PEAR warning
- return TREE_ERROR_HAS_CHILDREN;
+ return $this->_throwError("Element with id=$id has children, cant be
removed. Set 'setRemoveRecursively' to true to allow this.",__LINE__);
}
}
@@ -1285,6 +1285,7 @@
*/
function copy( $srcId , $destId )
{
+ return $this->dataSourceClass->copy( $srcId , $destId );
/*
remove all array elements after 'parent' since those had been created
and remove id and set parentId and that should be it, build the tree and pass it to addNode