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

Class: Tree_Memory_Array

Source Location: /Tree-0.3.7/Tree/Memory/Array.php

Class Overview


EXPERIMENTAL


Author(s):

Version:

  • 2002/08/30

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 31]
EXPERIMENTAL


[ Top ]


Class Variables

$data = array()

[line 34]


Type:   mixed


[ Top ]



Method Detail

Tree_Memory_Array (Constructor)   [line 53]

Tree_Memory_Array Tree_Memory_Array( &$array, [array $options = array()], string $dsn)

set up this object

Parameters:

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

[ Top ]

add   [line 204]

void add( array $data, int $parentId, [int $previousId = null])

add a new item to the tree what is tricky here, we also need to add it to the source array

Parameters:

array   $data   —  the data for the new node
int   $parentId   —  the ID of the parent node
int   $previousId   —  the ID of the previous node

[ Top ]

remove   [line 326]

void remove( int $id)

remove an element from the tree this removes all the children too

Parameters:

int   $id   —  the id of the element to be removed

[ Top ]

setData   [line 135]

void setData( $data)

this is mostly used by switchDataSource

this method put data gotten from getNode() in the $this->_array


Parameters:

   $data   — 

[ Top ]

setup   [line 70]

boolean setup( )

  • Return: true on success
  • Author: Wolfram Kriesing <wolfram@kriesing.de>
  • Version: 2002/08/30
  • Access: public

[ Top ]

update   [line 273]

void update( int $id, array $data)

update an entry with the given id and set the data as given in the array $data

Parameters:

int   $id   —  the id of the element that shall be updated
array   $data   —  the data, [key]=>[value]

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:47:03 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.