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']
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=="")
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
Function that deletes a subtree.
Bool
deleteTree
(String $name)
-
String
$name: contains the node name of the root.
Function that determines if a node exists.
Bool
existsNode
(String $nodeName)
-
String
$nodeName: contains a node name.
Function that returns the names of all nodes of the subtree with node as root.
Mixed
getAllNodes
(String $rootNode, $completePath)
-
String
$rootNode: contains the name of the root of subtree.
-
$completePath
This function returns all the elements types in the structure
Array
getElements
()
Function that returns the id value of a node
Integer
getId
(String $nodeName)
-
String
$nodeName: contains an existing node name.
Function that returns the inmediates children of a node.
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
Function that returns the id value of a node
Integer
getName
( $nodeid, String $nodeName)
-
String
$nodeName: contains an existing node name.
-
$nodeid
Function that returns the node name without the complete path.
String
getRealName
(String $name)
-
String
$name: contains the node name.
Function that returns the type of a node.
Mixed
getType
(String $nodo)
-
String
$nodo: contains the node name.
This function checks if a given name is an element or not.
Bool
isElementName
(String $name)
-
String
$name: Name with the element to check.
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
This function print the structure tree in html.
void
muestraArbol
()
It determines if a node name is valid (not contains any special characters).
Bool
validateName
(String $name)
-
String
$name: contains the node name to validate.