You are here

function simplenews_subscription_update in Simplenews 7.2

Same name and namespace in other branches
  1. 7 simplenews.module \simplenews_subscription_update()

Update subscriber objects in the database.

@todo Replace with simplenews_subscription_save() ?

Parameters

$conditions: Array of selection conditions. e.g. array('newsletter_id' => 5, 'snid' => 12).

$data: Associative array of database fields to be updated.

Related topics

File

./simplenews.module, line 1677
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_subscription_update($conditions = array(), $data) {
  $query = db_update('simplenews_subscription');
  foreach ($conditions as $key => $condition) {
    $query
      ->condition($key, $condition);
  }
  $query
    ->fields($data);
  $query
    ->execute();
}