*/
static function isError($data, $code = null)
{
- if (is_a($data, 'MDB2_Error')) {
+ if ($data instanceof MDB2_Error) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
*/
static function isConnection($value)
{
- return is_a($value, 'MDB2_Driver_Common');
+ return ($value instanceof MDB2_Driver_Common);
}
// }}}
*/
static function isResult($value)
{
- return is_a($value, 'MDB2_Result');
+ return $value instanceof MDB2_Result;
}
// }}}
*/
static function isResultCommon($value)
{
- return is_a($value, 'MDB2_Result_Common');
+ return ($value instanceof MDB2_Result_Common);
}
// }}}
*/
static function isStatement($value)
{
- return is_a($value, 'MDB2_Statement_Common');
+ return $value instanceof MDB2_Statement_Common;
}
// }}}
$this->val =new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
}
- function MDB2_Schema_Parser($variables, $fail_on_invalid_names = true,
- $structure = false, $valid_types = array(),
- $force_defaults = true)
- {
- $this->__construct($variables, $fail_on_invalid_names, $structure, $valid_types, $force_defaults);
- }
-
function startHandler($xp, $element, $attribs)
{
if (strtolower($element) == 'variable') {
$this->element = implode('-', $this->elements);
}
- function &raiseError($msg = null, $xmlecode = 0, $xp = null, $ecode = MDB2_SCHEMA_ERROR_PARSE,$a=null,$b=null,$c=null)
+ function raiseError($msg = null, $xmlecode = 0, $xp = null, $ecode = MDB2_SCHEMA_ERROR_PARSE,$a=null,$b=null,$c=null)
{
if (is_null($this->error)) {
$error = '';
$this->force_defaults = $force_defaults;
}
- function MDB2_Schema_Validate($fail_on_invalid_names = true, $valid_types = array(), $force_defaults = true)
- {
- $this->__construct($fail_on_invalid_names, $valid_types, $force_defaults);
- }
-
// }}}
// {{{ raiseError()
*/
static function isError($data, $code = null)
{
- if (is_a($data, 'PEAR_Error')) {
+ if ($data instanceof PEAR_Error) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
function setErrorHandling($mode = null, $options = null)
{
- if (isset($this) && is_a($this, 'PEAR')) {
+ if (isset($this) && $this instanceof PEAR) {
$setmode = &$this->_default_error_mode;
$setoptions = &$this->_default_error_options;
} else {
$code = null,
$userinfo = null)
{
- if (isset($this) && is_a($this, 'PEAR')) {
+ if (isset($this) && $this instanceof PEAR) {
return $this->raiseError($message, $code, null, null, $userinfo);
} else {
return PEAR::raiseError($message, $code, null, null, $userinfo);
function pushErrorHandling($mode, $options = null)
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
- if (isset($this) && is_a($this, 'PEAR')) {
+ if (isset($this) && $this instanceof PEAR) {
$def_mode = &$this->_default_error_mode;
$def_options = &$this->_default_error_options;
} else {
}
$stack[] = array($def_mode, $def_options);
- if (isset($this) && is_a($this, 'PEAR')) {
+ if (isset($this) && $this instanceof PEAR) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);
array_pop($stack);
list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack);
- if (isset($this) && is_a($this, 'PEAR')) {
+ if (isset($this) && $this instanceof PEAR) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);