function _notify_user_has_subscriptions in Notify 8
Same name and namespace in other branches
- 7 notify.module \_notify_user_has_subscriptions()
 - 1.0.x notify.module \_notify_user_has_subscriptions()
 
Helper function to check whether user has custom subscriptions.
3 calls to _notify_user_has_subscriptions()
- UserSettings::buildForm in src/
Form/ UserSettings.php  - Form constructor.
 - UserSettings::submitForm in src/
Form/ UserSettings.php  - Form submission handler.
 - _notify_send in ./
notify.module  - Helper function to send the notification e-mail batch.
 
File
- ./
notify.module, line 462  - Notify module sends e-mail digests of new content and comments.
 
Code
function _notify_user_has_subscriptions($userprofile) {
  $field = \Drupal::database()
    ->select('notify_subscriptions', 'n')
    ->fields('n', array(
    'uid',
  ))
    ->condition('uid', $userprofile)
    ->execute()
    ->fetchObject();
  $subscriber = $field ? TRUE : FALSE;
  return $subscriber;
}