You are here

function webform_dynamic_delete_rule in Webform Validation 7

Same name and namespace in other branches
  1. 6 webform_validation.rules.inc \webform_dynamic_delete_rule()

Delete a rule and dependencies.

Parameters

int $ruleid: The ruleid of the rule to delete.

3 calls to webform_dynamic_delete_rule()
webform_validation_delete_rule_submit in ./webform_validation.admin.inc
Submit handler to delete a rule.
webform_validation_entity_uuid_save in ./webform_validation.module
Implements hook_entity_uuid_save().
webform_validation_node_delete in ./webform_validation.module
Implements hook_node_delete().

File

./webform_validation.rules.inc, line 125
Provides API and management functions for the webform validation rules.

Code

function webform_dynamic_delete_rule($ruleid) {
  $transaction = db_transaction();

  // Delete rule.
  db_delete('webform_validation_rule')
    ->condition('ruleid', $ruleid)
    ->execute();

  // Delete rule components.
  db_delete('webform_validation_rule_components')
    ->condition('ruleid', $ruleid)
    ->execute();
}