63 $this->_callback = $callback;
64 $this->_params = &$params;
71 function run(&$node, $recursive=
false)
74 foreach ($node->getDataTypes() as $dataType)
76 foreach ($node->getValueNames($dataType) as $valueName)
78 $params = array(&$node, $valueName, $dataType);
80 $params[
sizeof($params)] = &$this->_params[$i];
84 if ($this->_obj === null)
85 call_user_func_array($this->_callback, $params);
87 call_user_method_array($this->_callback, $this->_obj, $params);
93 $children = $node->getChildren();
94 for ($i=0; $i<
sizeof($children); $i++)
95 $this->
run($children[$i], $recursive);
NodeProcessor is used to iterate over all values of a Node and apply a given callback function...
run(&$node, $recursive=false)
NodeProcessor($callback, $params=array(), $obj=null)