You are here

function rules_filter_array in Rules 7.2

Filters the given array of arrays.

This filter operates by keeping only entries which have $key set to the value of $value.

Parameters

array $array: The array of arrays to filter.

$key: The key used for the comparison.

$value: The value to compare the array's entry to.

Return value

array The filtered array.

6 calls to rules_filter_array()
RulesAbstractPlugin::rebuildCache in includes/rules.core.inc
Add in the data provided by the info hooks to the cache.
RulesReactionRule::parameterInfo in includes/rules.plugins.inc
rules_admin_components_overview in rules_admin/rules_admin.inc
Components overview.
rules_admin_component_options in rules_admin/rules_admin.inc
rules_get_components in ./rules.module
Returns an array of configured components.

... See full list

File

./rules.module, line 1135
Rules engine module.

Code

function rules_filter_array($array, $key, $value) {
  $return = array();
  foreach ($array as $i => $entry) {
    $entry += array(
      $key => NULL,
    );
    if ($entry[$key] == $value) {
      $return[$i] = $entry;
    }
  }
  return $return;
}