/** * c-tor * * @param res scalar One of PERM_XXX contants * @param perm string Permission requested * @param object RM_Permission_iPermissionable Object caused permission exception * @param userId int User ID, NULL - current user */ public function __construct($res, $perm, RM_Permission_iPermissionable $object, $userId = NULL) { foreach (qw2('res perm object userId') as $i) { $this->{$i} = ${$i}; } $p = array(PERM_UNDEF => 'undefined', PERM_ALLOW => 'allow', PERM_PWD_REQUIRED => 'password is required', PERM_PWD_WRONG => 'password is wrong', PERM_DENY => 'access denied'); parent::__construct("Permission denied - " . $p[$res], 0); }
public function __construct(RM_Base_iResult $result) { $this->_result = $result; $errors = $warnings = array(); foreach ($result->getErrors() as $e) { $code = $e['code']; unset($e['code']); $place = $e['place']; unset($e['place']); $errors[] = "\n error `{$code}' at `{$place}' (extra=" . var_export($e, TRUE) . ")"; } foreach ($result->getWarnings() as $e) { $code = $e['code']; unset($e['code']); $place = $e['place']; unset($e['place']); $warnings[] = "\n warning `{$code}' at `{$place}' (extra=" . var_export($e, TRUE) . ")"; } parent::__construct("Validation failed (errors: " . count($errors) . ", warnings: " . count($warnings) . ")." . join("", $errors) . join("", $warnings)); }
public function __construct($msg) { parent::__construct("OFS: {$msg}"); }
public function __construct($msg) { parent::__construct($msg, 0); }
public function __construct($errInfo, $query, $binds) { parent::__construct("DB: " . @$errInfo[2] . '/' . @$errInfo[0] . ". Query: {$query}. Binds: " . var_export($binds, TRUE), @$errInfo[1]); }