function rules_update_array in Rules 7.2
Merges the $update array into $array.
Makes sure no values of $array not appearing in $update are lost.
Return value
array The updated array.
2 calls to rules_update_array()
- RulesContainerPlugin::variableInfoAssertions in includes/
rules.core.inc - Returns asserted additions to the available variable info.
- RulesData::addMetadataAssertions in includes/
rules.state.inc - Adds asserted metadata to the variable info.
File
- ./
rules.module, line 1154 - Rules engine module.
Code
function rules_update_array(array $array, array $update) {
foreach ($update as $key => $data) {
if (isset($array[$key]) && is_array($array[$key]) && is_array($data)) {
$array[$key] = rules_update_array($array[$key], $data);
}
else {
$array[$key] = $data;
}
}
return $array;
}