Class StructHandler

Description

This class implements a Nested Set Model.

Located in /structHandlerClass.php (line 58)


	
			
Method Summary
StructHandler __construct (String $nombreTabla, Array $parametros, [Bool $debug = false])
Bool addChild (String $nodeName, String $type, String $parentName, String $brotherName, [Bool $debug = false])
Bool deleteTree (String $name)
Bool existsNode (String $nodeName)
Mixed getAllNodes (String $rootNode,  $completePath)
Array getElements ()
Integer getId (String $nodeName)
Array getInmChildren (String $root, [ $completePath = false], String $campos)
Integer getName ( $nodeid, String $nodeName)
String getRealName (String $name)
Mixed getType (String $nodo)
Bool isElementName (String $name)
void loadStructureXML (Array $array, [Bool $debug = false])
void muestraArbol ()
Bool validateName (String $name)
Methods
Constructor __construct (line 83)

Parameters constructor

StructHandler __construct (String $nombreTabla, Array $parametros, [Bool $debug = false])
  • String $nombreTabla
  • Bool $debug: if true function will throw debug messages as USER_NOTICE
  • Array $parametros: of String $parametros: Associative array with tags: ['rel_char'] ['id_char'] ['tree_char'] ['root_name']
addChild (line 316)

Function that inserts a child into a tree.

If the $parentName is "" the new node will be the right brother of $brotherName. If the $brotherName is "" the new node will be the leftest child. ($parentName=="" XOR $brotherName=="")

  • return: True if the child was inserted. False if not.
  • access: public
Bool addChild (String $nodeName, String $type, String $parentName, String $brotherName, [Bool $debug = false])
  • String $nodeName: contains the name of the new child
  • String $type: contains a node type name.
  • String $parentName: contains the name of the parent.
  • String $brotherName: contains the name of the left brother.
  • Bool $debug: if true function will throw debug messages as USER_NOTICE
deleteTree (line 556)

Function that deletes a subtree.

  • return: True if it has been deleted. False if not.
  • access: public
Bool deleteTree (String $name)
  • String $name: contains the node name of the root.
existsNode (line 619)

Function that determines if a node exists.

  • return: True if the node exists. False if not.
  • access: public
Bool existsNode (String $nodeName)
  • String $nodeName: contains a node name.
getAllNodes (line 817)

Function that returns the names of all nodes of the subtree with node as root.

  • return: Array of String with the names, -1 if the rootNode doesn't exist.
  • access: public
Mixed getAllNodes (String $rootNode,  $completePath)
  • String $rootNode: contains the name of the root of subtree.
  • $completePath
getElements (line 924)

This function returns all the elements types in the structure

  • return: Array of String with the elements types.
  • access: public
Array getElements ()
getId (line 731)

Function that returns the id value of a node

  • return: ID value of the node, or -1 if the node doesn't exist.
  • access: public
Integer getId (String $nodeName)
  • String $nodeName: contains an existing node name.
getInmChildren (line 767)

Function that returns the inmediates children of a node.

  • return: Array of String with the fields as tags.
  • access: public
Array getInmChildren (String $root, [ $completePath = false], String $campos)
  • String $campos: contains the fields we want to get separated with ','
  • String $root: contains the root name.
  • $completePath
getName (line 749)

Function that returns the id value of a node

  • return: ID value of the node, or -1 if the node doesn't exist.
  • access: public
Integer getName ( $nodeid, String $nodeName)
  • String $nodeName: contains an existing node name.
  • $nodeid
getRealName (line 243)

Function that returns the node name without the complete path.

  • return: String which contains the local name.
  • access: public
String getRealName (String $name)
  • String $name: contains the node name.
getType (line 878)

Function that returns the type of a node.

  • return: String with the type of the node, or -1 if the node doesn't exist.
  • access: public
Mixed getType (String $nodo)
  • String $nodo: contains the node name.
isElementName (line 936)

This function checks if a given name is an element or not.

  • return: True if the element exists, false if not.
  • access: public
Bool isElementName (String $name)
  • String $name: Name with the element to check.
loadStructureXML (line 120)

This function loads all the xml structure from an array

void loadStructureXML (Array $array, [Bool $debug = false])
  • Array $array: with the information
  • Bool $debug: if true function will throw debug messages as USER_NOTICE
muestraArbol (line 150)

This function print the structure tree in html.

  • access: public
void muestraArbol ()
validateName (line 197)

It determines if a node name is valid (not contains any special characters).

  • return: true if the name is valid. false if not.
  • access: public
Bool validateName (String $name)
  • String $name: contains the node name to validate.

Documentation generated by phpDocumentor 1.4.3
Modified by Sergio Barja for S2 - Hierarchical Data Model documentation.