You are here

function Notifications_Subscription::save_fields in Notifications 7

Same name and namespace in other branches
  1. 6.4 includes/notifications_subscription.class.inc \Notifications_Subscription::save_fields()

Save condition fields to db

Parameters

$update: Whether this is an old subscription being created

3 calls to Notifications_Subscription::save_fields()
Notifications_Subscription::insert in ./notifications.subscription.inc
Save to db
Notifications_Subscription::save in ./notifications.subscription.inc
Save to db
Notifications_Subscription::update in ./notifications.subscription.inc
Update db

File

./notifications.subscription.inc, line 1145
Drupal Notifications Framework - Default class file

Class

Notifications_Subscription
Common base for subscription type and subscription instance

Code

function save_fields($update = FALSE) {
  $result = TRUE;
  if (isset($this->fields)) {
    if ($update) {
      db_query('DELETE FROM {notifications_subscription_fields} WHERE sid = :sid', array(
        ':sid' => $this->sid,
      ));
    }
    foreach ($this
      ->get_fields() as $field) {
      $field
        ->set_subscription($this);
      $result = $result && $field
        ->save();
    }
  }
  return $result;
}