You are here

function variable_set_value in Variable 7

Same name and namespace in other branches
  1. 7.2 variable.module \variable_set_value()

Set variable value

This basically sets the variable but also invokes hook_variable_update

Related topics

1 call to variable_set_value()
VariableTestCase::testVariableAPI in ./variable.test
Test that all core modules can be enabled, disabled and uninstalled.

File

./variable.module, line 252
Variable API module

Code

function variable_set_value($name, $value, $options = array()) {
  $old_value = variable_get($name, NULL, $options);
  if (!empty($options['realm'])) {
    $options['realm']
      ->variable_set($name, $value);
  }
  else {
    variable_set($name, $value);
  }
  module_invoke_all('variable_update', $name, $value, $old_value, $options);
}