You are here

public function RulesPlugin::delete in Rules 7.2

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 1234
Rules base classes and interfaces needed for any rule evaluation.

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();
  }
}