function rules_gather_data in Rules 6
Gathers module definitions for the given name Used for collecting events, rules, actions and condtions from other modules
Parameters
$name The type of the data item to collect. This is also the name of the invoked hook.:
$key Whether to retrieve all definitions or only the one with the given key:
$alter Whether drupal_alter() should be invoked for this data:
$reset If the static cache should be reseted. Note that if set to true, nothing will be: returned.
12 calls to rules_gather_data()
- rules_admin_elements_get_logical_ops in rules_admin/
rules_admin.rule_forms.inc - Returns a list of available logical operations suitable for use with #options
- rules_clear_cache in rules/
rules.module - Clears the rule set cache
- rules_get_actions in rules/
rules.module - Returns info about all defined actions
- rules_get_conditions in rules/
rules.module - Returns info about all defined conditions
- rules_get_data_types in rules/
rules.module - Returns info about all defined data types
File
- rules/
rules.module, line 103 - Rules engine module
Code
function rules_gather_data($name, $key = 'all', $alter = TRUE, $reset = FALSE) {
static $data = array();
if ($reset) {
$data = array();
return $data;
}
if (!isset($data[$name])) {
rules_include('rules');
$data[$name] = module_invoke_all($name);
if ($alter) {
drupal_alter($name, $data[$name]);
}
}
if ($key != 'all') {
$data[$name] += array(
$key => NULL,
);
return $data[$name][$key];
}
return $data[$name];
}