function RulesPlugin::delete
Deletes configuration from database.
If invoked on a rules configuration it is deleted from database. If invoked on a contained rule element, it's removed from the configuration.
1 call to RulesPlugin::delete()
- RulesContainerPlugin::delete in includes/
rules.core.inc - Overrides delete to keep the children alive, if possible.
1 method overrides RulesPlugin::delete()
- RulesContainerPlugin::delete in includes/
rules.core.inc - Overrides delete to keep the children alive, if possible.
File
-
includes/
rules.core.inc, line 1245
Class
- RulesPlugin
- Base class for rules plugins.
Code
public function delete() {
if (isset($this->parent)) {
foreach ($this->parent->children as $key => $child) {
if ($child === $this) {
unset($this->parent->children[$key]);
break;
}
}
}
elseif (isset($this->id)) {
entity_get_controller('rules_config')->delete(array(
$this->name,
));
rules_clear_cache();
}
}