function rules_admin_is_valid_data_type in Rules 6
Determines if the given data type is valid for the given argument.
Parameters
$data_type: The data type to check.
$arg_type: The arguments needed data type.
Return value
True or false.
1 call to rules_admin_is_valid_data_type()
- rules_admin_map_get_possible_arguments in rules_admin/
rules_admin.inc - Gets the possible variables (= of the same entity) for an argument
File
- rules_admin/
rules_admin.inc, line 119
Code
function rules_admin_is_valid_data_type($data_type, $arg_type) {
if (is_array($arg_type)) {
foreach ($arg_type as $type) {
// We have multiple options to check for.
if (rules_admin_is_valid_data_type($data_type, $type)) {
return TRUE;
}
}
return FALSE;
}
if ($arg_type == '*') {
return TRUE;
}
return $arg_type == $data_type;
}