public function FeedsSource::startClear in Feeds 7.2
Start deleting all imported items of a source.
This method starts a clear job. Depending on the configuration of the importer of this source, a Batch API job or a background job with Job Scheduler will be created.
Throws
Exception If processing in background is enabled, the first batch chunk of the clear task will be executed on the current page request. This means that this method may throw the same exceptions as FeedsSource::clear().
File
- includes/
FeedsSource.inc, line 369 - Definition of FeedsSourceInterface, FeedsState and FeedsSource class.
Class
- FeedsSource
- Holds the source of a feed to import.
Code
public function startClear() {
$config = $this->importer
->getConfig();
if ($config['process_in_background']) {
$this
->startBackgroundJob('clear');
}
else {
$this
->startBatchAPIJob(t('Deleting'), 'clear');
}
}