public function __call($name, $arguments) { if ($name[0] === '_') { $realName = substr($name, 1); if (ar_pinp::isAllowed($this, $realName)) { return call_user_func_array(array($this, $realName), $arguments); } else { $trace = debug_backtrace(0, 2); trigger_error("Method {$realName} not found in class " . get_class($this) . " Called from line " . $trace[1]['line'] . " in " . $trace[1]['file'], E_USER_WARNING); } } else { $trace = debug_backtrace(0, 2); trigger_error("Method {$name} not found in class " . get_class($this) . " Called from line " . $trace[1]['line'] . " in " . $trace[1]['file'], E_USER_WARNING); } }
protected function bindValue($source, $type) { if ($source instanceof ar_xmlNode || $source instanceof ar_xmlNodes) { $nodeValue = $source->nodeValue; if (is_array($nodeValue) && !count($nodeValue)) { $nodeValue = null; } } else { $nodeValue = $source; } if (is_callable($type)) { $nodeValue = call_user_func($type, $source); } else { switch ($type) { case 'int': $nodeValue = (int) $nodeValue; break; case 'float': $nodeValue = (double) $nodeValue; break; case 'string': $nodeValue = (string) $nodeValue; break; case 'bool': $nodeValue = (bool) $nodeValue; break; case 'url': $nodeValue = ar::url($nodeValue); break; case 'xml': case 'html': if ($source instanceof ar_xmlNode || $source instanceof ar_xmlNodes) { $nodeValue = (string) $source; } break; default: if (is_string($type) && class_exists($type) && ar_pinp::isAllowed($type, '__construct')) { $nodeValue = new $type($nodeValue); } break; } } return $nodeValue; }
public function __call($name, $arguments) { if ($name[0] === '_') { $realName = substr($name, 1); if (ar_pinp::isAllowed($this, $realName)) { return call_user_func_array(array($this, $realName), $arguments); } else { trigger_error("Method {$realName} not found in class " . get_class($this), E_USER_WARNING); } } else { trigger_error("Method {$name} not found in class " . get_class($this), E_USER_WARNING); } }