You are here

public static function Notifications_Subscription::load_single in Notifications 7

Load single subscription from db

1 call to Notifications_Subscription::load_single()
Notifications_Subscription::load_single_instance in ./notifications.subscription.inc
Get single instance form the db

File

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

Class

Notifications_Subscription
Common base for subscription type and subscription instance

Code

public static function load_single($conditions, $fields = array(), $limit = FALSE) {
  $query = self::select_subscriptions($conditions, $fields, $limit);
  $query
    ->range(0, 1);
  if ($sid = $query
    ->execute()
    ->fetchField()) {
    return self::load($sid);
  }
  else {
    return array();
  }
}