/** * NModelError constructor. * * @param mixed NModel error code, or string with error message. * @param integer what "error mode" to operate in * @param integer what error level to use for $mode & PEAR_ERROR_TRIGGER * @param mixed additional debug info, such as the last query * * @access public * * @see PEAR_Error */ function Model_Error($code = N_DAO_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null) { if (is_int($code)) { $this->PEAR_Error('N_DAO Error: ' . NModel::errorMessage($code), $code, $mode, $level, $debuginfo); } else { $this->PEAR_Error("N_DAO Error: {$code}", N_DAO_ERROR, $mode, $level, $debuginfo); } }