[eluser]Unknown[/eluser]
Just a heads-up - check the code of this library before using it, cause you can get a bad surprise from some methods. For example, the method
Code:
public function checkNodeIsChild($testNode, $controlNode) {
return ($testNode[$this->parent_column_name] == $controlNode[$this->primary_key_column_name]);
}
This method will return TRUE ONLY IF the $testNode is a direct child of the $controlNode. If it is down the tree more than one level, the method will return FALSE while the test node is still a child of the control.
From my point of view this method should look like this:
Code:
public function checkNodeIsChild($testNode, $controlNode) {
return ($testNode[$this->left_column_name]>$controlNode[$this->left_column_name]
&& $testNode[$this->right_column_name]<$controlNode[$this->right_column_name]);
}