You are here

protected function FeedsSource::startBatchAPIJob in Feeds 7.2

Batch API helper. Starts a Batch API job.

Parameters

string $title: Title to show to user when executing batch.

string $method: Method to execute on importer; one of 'import' or 'clear'.

See also

FeedsSource::startImport()

FeedsSource::startClear()

feeds_batch()

2 calls to FeedsSource::startBatchAPIJob()
FeedsSource::startClear in includes/FeedsSource.inc
Start deleting all imported items of a source.
FeedsSource::startImport in includes/FeedsSource.inc
Start importing a source.

File

includes/FeedsSource.inc, line 1205
Definition of FeedsSourceInterface, FeedsState and FeedsSource class.

Class

FeedsSource
Holds the source of a feed to import.

Code

protected function startBatchAPIJob($title, $method) {
  $batch = array(
    'title' => $title,
    'operations' => array(
      array(
        'feeds_batch',
        array(
          $method,
          $this->id,
          $this->feed_nid,
        ),
      ),
    ),
    'progress_message' => '',
  );
  batch_set($batch);
}