You are here

function rules_item_save in Rules 6

Saves the given item to the database

11 calls to rules_item_save()
rules_admin_form_add_rule_set_submit in rules_admin/rules_admin.sets.inc
rules_admin_form_add_rule_submit in rules_admin/rules_admin.rule_forms.inc
rules_admin_form_edit_rule_set_submit in rules_admin/rules_admin.sets.inc
rules_admin_form_import_submit in rules_admin/rules_admin.export.inc
rules_admin_import_workflow_ng in rules_admin/rules_admin.export.inc
Tries to import workflow-ng rules.

... See full list

File

rules/rules.module, line 817
Rules engine module

Code

function rules_item_save($item_type, $name, $item) {
  if ($info = rules_get_items($item_type)) {
    db_query("DELETE FROM {" . $info['db_table'] . "} WHERE name = '%s'", $name);
    db_query("INSERT INTO {" . $info['db_table'] . "} (name, data) VALUES ('%s', %b)", $name, serialize($item));
  }
}