You are here

function cmfcClassesCore::raiseError in Calendar Systems 5

conditionally includes PEAR base class and raise an error @example <code> return $this->raiseError('', CMF_Language_Error_Unknown_Short_Name, * PEAR_ERROR_RETURN,NULL, * array('shortName'=>$shortName) * ); </code>

@access private

Parameters

string $msg Error message:

int $code Error code:

Overrides PEAR::raiseError

File

calendar/lib/classesCore.class.inc.php, line 227

Class

cmfcClassesCore
all cmf classes inherit from this class

Code

function raiseError($message = null, $code = null, $mode = null, $options = null, $userinfo = null, $error_class = null, $skipmsg = false) {
  if (isset($this->_messagesValue[$code]) && empty($message)) {
    $message = $this->_messagesValue[$code];
  }
  if (is_array($userinfo) && !empty($message)) {
    if (is_array($userinfo)) {
      foreach ($userinfo as $key => $value) {
        $replacements['%' . $key . '%'] = $value;
      }
    }
    $message = cmfcString::replaceVariables($replacements, $message);
  }
  return PEAR::raiseError($message, $code, $mode, $options, $userinfo, $error_class, $skipmsg);
}