You are here

function Notifications_Subscription::save_fields in Notifications 6.4

Same name and namespace in other branches
  1. 7 notifications.subscription.inc \Notifications_Subscription::save_fields()

Save condition fields to db

Parameters

$update: Whether this is an old subscription being created

2 calls to Notifications_Subscription::save_fields()
Notifications_Subscription::insert in includes/notifications_subscription.class.inc
Save to db
Notifications_Subscription::update in includes/notifications_subscription.class.inc
Update db

File

includes/notifications_subscription.class.inc, line 418
Drupal Notifications Framework - Default class file

Class

Notifications_Subscription
Message destination class

Code

function save_fields($update = FALSE) {
  if (isset($this->fields)) {
    if ($update) {
      db_query("DELETE FROM {notifications_fields} WHERE sid = %d", $this->sid);
    }
    foreach ($this->fields as $field) {
      db_query("INSERT INTO {notifications_fields} (sid, field, value, intval) VALUES(%d, '%s', '%s', %d)", $this->sid, $field->field, $field->value, (int) $field->value);
    }
  }
}