class PuSHSubscription in Feeds 6
Same name and namespace in other branches
- 7.2 plugins/FeedsHTTPFetcher.inc \PuSHSubscription
- 7 plugins/FeedsHTTPFetcher.inc \PuSHSubscription
Implement a PuSHSubscriptionInterface.
Hierarchy
- class \PuSHSubscription implements PuSHSubscriptionInterface
Expanded class hierarchy of PuSHSubscription
1 string reference to 'PuSHSubscription'
- FeedsHTTPFetcher::subscriber in plugins/
FeedsHTTPFetcher.inc - Convenience method for instantiating a subscriber object.
File
- plugins/
FeedsHTTPFetcher.inc, line 220
View source
class PuSHSubscription implements PuSHSubscriptionInterface {
public $domain;
public $subscriber_id;
public $hub;
public $topic;
public $status;
public $secret;
public $post_fields;
public $timestamp;
/**
* Load a subscription.
*/
public static function load($domain, $subscriber_id) {
if ($v = db_fetch_array(db_query("SELECT * FROM {feeds_push_subscriptions} WHERE domain = '%s' AND subscriber_id = %d", $domain, $subscriber_id))) {
$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']);
}
}
/**
* Create a subscription.
*/
public function __construct($domain, $subscriber_id, $hub, $topic, $secret, $status = '', $post_fields = '') {
$this->domain = $domain;
$this->subscriber_id = $subscriber_id;
$this->hub = $hub;
$this->topic = $topic;
$this->status = $status;
$this->secret = $secret;
$this->post_fields = $post_fields;
}
/**
* Save a subscription.
*/
public function save() {
$this->timestamp = time();
$this
->delete($this->domain, $this->subscriber_id);
drupal_write_record('feeds_push_subscriptions', $this);
}
/**
* Delete a subscription.
*/
public function delete() {
db_query("DELETE FROM {feeds_push_subscriptions} WHERE domain = '%s' AND subscriber_id = %d", $this->domain, $this->subscriber_id);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PuSHSubscription:: |
public | property | ||
PuSHSubscription:: |
public | property | ||
PuSHSubscription:: |
public | property | ||
PuSHSubscription:: |
public | property | ||
PuSHSubscription:: |
public | property | ||
PuSHSubscription:: |
public | property | ||
PuSHSubscription:: |
public | property | ||
PuSHSubscription:: |
public | property | ||
PuSHSubscription:: |
public | function |
Delete a subscription. Overrides PuSHSubscriptionInterface:: |
|
PuSHSubscription:: |
public static | function |
Load a subscription. Overrides PuSHSubscriptionInterface:: |
|
PuSHSubscription:: |
public | function |
Save a subscription. Overrides PuSHSubscriptionInterface:: |
|
PuSHSubscription:: |
public | function |
Create a subscription. Overrides PuSHSubscriptionInterface:: |