You are here

function party_simplenews_simplenews_subscriber_update in Party 8.2

Implements hook_simplenews_subscriber_update.

Because simplenews uses a custom query object rather than calling drupal_write_record, we have to manually save our extra fields. This can stay in the update hook, as our implementation of the insert hook will end up calling this anyway.

File

modules/party_simplenews/party_simplenews.module, line 152
Main module file for Party Simplenews integration

Code

function party_simplenews_simplenews_subscriber_update($subscriber) {
  db_merge('party_simplenews_subscriber')
    ->key(array(
    'snid' => $subscriber->snid,
  ))
    ->fields(array(
    'party_field_ref' => $subscriber->party_field_ref,
    'party_id' => $subscriber->party_id,
  ))
    ->execute();
}