You are here

public static function PuSHSubscription::load in Feeds 7.2

Same name and namespace in other branches
  1. 6 plugins/FeedsHTTPFetcher.inc \PuSHSubscription::load()
  2. 7 plugins/FeedsHTTPFetcher.inc \PuSHSubscription::load()

Load a subscription.

Overrides PuSHSubscriptionInterface::load

File

plugins/FeedsHTTPFetcher.inc, line 395

Class

PuSHSubscription
Implement a PuSHSubscriptionInterface.

Code

public static function load($domain, $subscriber_id) {
  if ($v = db_query("SELECT * FROM {feeds_push_subscriptions} WHERE domain = :domain AND subscriber_id = :sid", array(
    ':domain' => $domain,
    ':sid' => $subscriber_id,
  ))
    ->fetchAssoc()) {
    $v['post_fields'] = unserialize($v['post_fields']);
    return new PuSHSubscription($v['domain'], $v['subscriber_id'], $v['hub'], $v['topic'], $v['secret'], $v['status'], $v['post_fields'], $v['timestamp']);
  }
}