mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-20 05:45:11 -04:00
Add module::clear_var()
This commit is contained in:
@@ -243,4 +243,19 @@ class module_Core {
|
||||
$var->value = $value;
|
||||
$var->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a variable for this module.
|
||||
* @param string $module_name
|
||||
* @param string $name
|
||||
*/
|
||||
public function clear_var($module_name, $name) {
|
||||
$var = ORM::factory("var")
|
||||
->where("module_name", $module_name)
|
||||
->where("name", $name)
|
||||
->find();
|
||||
if ($var->loaded) {
|
||||
$var->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user