public static function cf_error::missing_array_key in Common Functionality 7.2
Reports that a given array is missing a specific array key.
@see: watchdog() @see: watchdog_severity_levels()
Parameters
string $argument_names: The variable name of the argument in question.
string $key_name: The name of the array key that is missing.
int $severity: (optional) The severity of the message, as per RFC 3164. Possible values are WATCHDOG_ERROR, WATCHDOG_WARNING, etc.
Return value
cf_error_code A object containing the processed error, with specified backtrace.
2 calls to cf_error::missing_array_key()
- cf_error_missing_array_key in modules/
cf_1x_compatibility/ cf_1x_compatibility.module - This is a compatibility function for cf-1.x.
- cf_is_not_form_state in ./
cf.module - Checks if the argument is a valid drupal form state array.
File
- modules/
cf_error/ classes/ cf_error.php, line 301 - Provides the derror exception class.
Class
Code
public static function missing_array_key($argument_name, $key_name, $severity = WATCHDOG_ERROR) {
$error = new cf_error_code();
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, self::p_backtrace_limit());
}
else {
$backtrace = debug_backtrace();
}
if (empty($argument_name)) {
$argument_name = self::p_report_invalid_argument_string('argument_name', $backtrace);
unset($backtrace);
}
if (empty($key_name)) {
$key_name = self::p_report_invalid_argument_string('key_name', $backtrace);
unset($backtrace);
}
$error
->set_severity($severity);
self::p_load_backtrace($error);
self::p_missing_array_key($error, $argument_name, $key_name);
return $error;
}