/** * Forward to DOMXPath->registerPHPFunctions() * * @param mixed $restrict Array of function names or string with functionname to restrict callabilty to * * @throws fDOMException * * @return void */ public function registerPHPFunctions($restrict = NULL) { if (is_null($this->xp)) { $this->getDOMXPath(); } $this->xp->registerPHPFunctions($restrict); if (libxml_get_last_error()) { throw new fDOMException("Registering php functions failed.", fDOMException::RegistrationFailed); } }
private function buildQuery(fDOMXPath $xp, array $values = NULL) { $backup = $this->values; if (count($values) > 0) { foreach ($values as $k => $v) { $this->bind($k, $v); } } $query = $xp->prepare($this->query, $this->values); $this->values = $backup; return $query; }