[ class tree: Tree ] [ index: Tree ] [ all elements ]

Class: Tree_Memory_Filesystem

Source Location: /Tree-0.3.3/Memory/Filesystem.php

Class Overview

the Filesystem interface to the tree class



  • 2001/06/27



Inherited Variables

Inherited Methods

Class Details

[line 43]
the Filesystem interface to the tree class

this is a bit different, as id we use the entire path, since we know this is unique in a filesystem and an integer id could only be created virtually, it doesnt have a tight connection to the actual directory i.e. using 'add' with ids could fail since we dont know if we get the same id when we call 'add' with a parentId to create a new folder under since our id would be made up. So we use the complete path as id, which takes up a lot of memory, i know but since php is typeless its possible and it makes life easier when we want to create another dir, since we get the dir as parentId passed to the 'add' method, which makes it easy to create a new dir there :-) I also thought about hashing the path name but then the add method is not that easy to implement ... may be one day :-)

[ Top ]

Class Variables

$options = array(
                        'order'     => '',
                        'columnNameMaps' => array(),)

[line 50]

  • Var: saves the options passed to the constructor
  • Access: public

Type:   array

[ Top ]

Method Detail

Tree_Memory_Filesystem (Constructor)   [line 66]

Tree_Memory_Filesystem Tree_Memory_Filesystem( $path, [array $options = array()], string $dsn)

set up this object


string   $dsn   —  the path on the filesystem
array   $options   —  additional options you can set
   $path   — 

[ Top ]

add   [line 130]

void add( $newValues, [ $parent = 0], [ $prevId = 0])

this is tricky on a filesystem, since we are working with id's as identifiers and we need to be sure, the parentId to create a node under is the same as when the tree was last read.

but this might be tricky.


   $newValues   — 
   $parent   — 
   $prevId   — 

[ Top ]

copy   [line 159]

void copy( $srcId, $destId)


   $srcId   — 
   $destId   — 

[ Top ]

remove   [line 148]

void remove( $id)


   $id   — 

[ Top ]

setup   [line 85]

boolean setup( )

retreive all the navigation data from the db and call build to build the tree in the array data and structure
  • Return: true on success
  • Author: Wolfram Kriesing <>
  • Version: 2001/11/20
  • Access: public

[ Top ]

Documentation generated on Thu, 10 Dec 2015 05:48:53 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.