You are here

public function FeedsClientsFetcher::fetch in Web Service Clients 7

Same name and namespace in other branches
  1. 6 clients/clients_feeds/FeedsClientsFetcher.inc \FeedsClientsFetcher::fetch()

Fetch a local resource.

File

clients/clients_feeds/FeedsClientsFetcher.inc, line 15
Home of the FeedsFileFetcher.

Class

FeedsClientsFetcher
Fetches data via HTTP.

Code

public function fetch(FeedsSource $source) {
  $source_config = $source
    ->getConfig();
  $resource = clients_resource_load((int) $source_config['FeedsClientsParser']['source']);
  $result = clients_call($resource);
  $items = isset($result[0]->data) ? $result[0]->data : array();

  // (feeds > alpha9)
  $batch = new FeedsImportBatch();
  $batch
    ->setItems($items);
  return $batch;
}