Tree: cannot remove nodes

From: Date: Sat, 03 May 2003 04:31:29 +0000
Subject: Tree: cannot remove nodes
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5210@lists.php.net to get a copy of this message
Hi, I'm trying to implement a menu which extends the Tree classes (specifically, Tree_Memory). I saw recent postings from Joseph Blythe and the replies from Wolfram were encouraging. I ran the DBsimple example, after doing the preparation stuff (modify the DSN on line 94, and run the CREATE TABLE on line 58). I got the following error: Fatal error: Call to undefined function: haschildren() in c:\php\pear\Tree\Memory\DBsimple.php on line 222 It would not be a problem if it was only the sample not working. But I got the error again when I implemented the remove() method in my scripts :-( I traced the error as far as I could, and found the following: 1) docs/Memory_DBsimple.php, line 155: $tree->remove(0); 2) The remove() method in Tree/Memory.php is called, and on line 434 it calls the remove() method appropriate for the dataSourceClass: return $this->dataSourceClass->remove( $id ); 3) Once in the dataSourceClass (Tree_Memory_DBsimple in DBsimple.php), the method fails when trying to fetch the children on line 222: if( $this->hasChildren($id) ) It seems that at this point $this is a tree_memory_dbsimple object, and for whatever reason I don't understand, it does not see the tree_memory class methods. Please, advise Regards, -- Daniel

« previous php.pear.general (#5210) next »