public static function Vars::deleteVariables in Variable API 6
Same name and namespace in other branches
- 6.2 vars.module \Vars::deleteVariables()
- 7.2 vars.classes.inc \Vars::deleteVariables()
- 7 vars.module \Vars::deleteVariables()
Deletes the specified persistent variables.
Deletes the specified persistent variables from memory, and from the database.
Parameters
$names: An array of persistent variable names.
See also
2 calls to Vars::deleteVariables()
- Vars::offsetUnset in ./
vars.module - Implements ArrayAccess::offsetUnset().
- VarsExtendedTestCase::testDeletingVars in tests/
vars.test
File
- ./
vars.module, line 62 - Implement an API to handle persistent variables.
Class
- Vars
- @file Implement an API to handle persistent variables.
Code
public static function deleteVariables(array $names) {
global $conf;
$count = 0;
foreach ($names as $name) {
unset($conf[$name]);
$count++;
}
if ($count) {
db_query("DELETE FROM {variable} WHERE name IN (" . db_placeholders($names, 'varchar') . ")", $names);
cache_clear_all('variables', 'cache');
}
}