cvs: pear /Tree Memory.php

From: Date: Sat, 04 May 2002 19:20:59 +0000
Subject: cvs: pear /Tree Memory.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-3699@lists.php.net to get a copy of this message
cain Sat May 4 15:20:59 2002 EDT Modified files: /pear/Tree Memory.php Log: - adapted the interface to work the same in Memory and Dynamic (update method) - switch to php-conform call_user_func parameters Index: pear/Tree/Memory.php diff -u pear/Tree/Memory.php:1.7 pear/Tree/Memory.php:1.8 --- pear/Tree/Memory.php:1.7 Tue Apr 23 17:09:52 2002 +++ pear/Tree/Memory.php Sat May 4 15:20:59 2002 @@ -16,7 +16,7 @@ // | Authors: Wolfram Kriesing <wolfram@kriesing.de> | // +----------------------------------------------------------------------+ // -// $Id: Memory.php,v 1.7 2002/04/23 21:09:52 cain Exp $ +// $Id: Memory.php,v 1.8 2002/05/04 19:20:59 cain Exp $ require_once('Tree/Common.php'); require_once('Tree/Error.php'); @@ -483,9 +483,9 @@ * @param array $data the data to update * @return */ - function update( $data ) + function update( $id , $data ) { - return $this->dataSourceClass->update($data); + return $this->dataSourceClass->update($id,$data); } // end of function @@ -607,11 +607,7 @@ { foreach( $curLevel as $key=>$value ) { - // call either an objects method or a function - if( is_array($walkFunction) ) - $ret = call_user_func( array($walkFunction[1],$walkFunction[0]) , $this->data[$key] ); - else - $ret = call_user_func( $walkFunction , $this->data[$key] ); + $ret = call_user_func( $walkFunction , $this->data[$key] ); switch( $returnType ) { @@ -1066,7 +1062,7 @@ $this->_getNodeMaxLevel = $depth ? ($depth + $level) : 0 ; #!!! $this->_getNodeCurParent = $this->data['parent']['id']; - return $this->walk( array('_getNode',$this) , $startId , 'ifArray' ); + return $this->walk( array(&$this,'_getNode') , $startId , 'ifArray' ); } // end of function /**

« previous php.pear.cvs (#3699) next »