You are here

function cf_error_invalid_object in Common Functionality 7

Same name and namespace in other branches
  1. 7.2 modules/cf_1x_compatibility/cf_1x_compatibility.module \cf_error_invalid_object()

Reports that a given argument is supposed to be an object but is not.

Why: See reason from cf_error_invalid_variable() function.

Parameters

array $function_history: An array of function names, ie: array('0' => 'my_function_name').

string $argument_name: The variable name of the argument in question.

int $severity: (optional) This is passed directly to watchdog and represents the severity of the report.

3 calls to cf_error_invalid_object()
cf_error_on_query_execution in modules/cf_error/cf_error.module
Reports query execution failures to the watchdog system.
cf_get_user in ./cf.module
Provide a safe way to get the current user.
cf_node_create in modules/cf_node/cf_node.module
Programatically creates a node of the form type and returns any errors. This flushes the error buffer allowing for multiple calls. This will always return an array.

File

modules/cf_error/cf_error.module, line 281

Code

function cf_error_invalid_object($function_history, $argument_name, $severity = WATCHDOG_ERROR) {
  cf_error_append_history($function_history, __FUNCTION__);
  if ($argument_name == '') {
    cf_error_empty_string($function_history, 'argument_name', $severity);
  }
  cf_error_invalid_variable($function_history, $argument_name, "Not a valid object.", array(), $severity);
}