You are here

function notifications_custom_build_subscription in Notifications 6

Same name and namespace in other branches
  1. 6.4 notifications_custom/notifications_custom.module \notifications_custom_build_subscription()

Get subscription object from custom subscription type

Parameters

$type: Custom subscription type

2 calls to notifications_custom_build_subscription()
notifications_custom_account_update in notifications_custom/notifications_custom.module
Update custom subscriptions for user account
notifications_custom_user_multiple_subscribe in notifications_custom/notifications_custom.module
User operations callback

File

notifications_custom/notifications_custom.module, line 326
Custom notifications module

Code

function notifications_custom_build_subscription($type) {
  if ($subs = notifications_custom_load($type)) {
    $subs->type = $type;
    $fields = $subs->fields;
    $subs->fields = array();
    foreach ($fields as $field) {
      $subs->fields[$field['type']] = $field['value'];
    }
    return $subs;
  }
}