You are here

public function FeedsHTTPFetcher::sourceSave in Feeds 7.2

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

Override sourceSave() - subscribe to hub.

Overrides FeedsPlugin::sourceSave

File

plugins/FeedsHTTPFetcher.inc, line 308

Class

FeedsHTTPFetcher
Fetches data via HTTP.

Code

public function sourceSave(FeedsSource $source) {
  if ($this->config['use_pubsubhubbub']) {

    // If this is a feeds node we want to delay the subscription to
    // feeds_exit() to avoid transaction race conditions.
    if ($source->feed_nid) {
      $job = array(
        'fetcher' => $this,
        'source' => $source,
      );
      feeds_set_subscription_job($job);
    }
    else {
      $this
        ->subscribe($source);
    }
  }
}