You are here

class FeedsFileBatch in Feeds 6

Same name and namespace in other branches
  1. 7 plugins/FeedsFileFetcher.inc \FeedsFileBatch

Definition of the import batch object created on the fetching stage by FeedsFileFetcher.

Hierarchy

Expanded class hierarchy of FeedsFileBatch

File

plugins/FeedsFileFetcher.inc, line 12
Home of the FeedsFileFetcher and related classes.

View source
class FeedsFileBatch extends FeedsImportBatch {
  protected $file_path;

  /**
   * Constructor.
   */
  public function __construct($file_path, $feed_nid = 0) {
    $this->file_path = $file_path;
    parent::__construct('', $feed_nid);
  }

  /**
   * Implementation of FeedsImportBatch::getRaw();
   */
  public function getRaw() {
    return file_get_contents(realpath($this->file_path));
  }

  /**
   * Implementation of FeedsImportBatch::getFilePath().
   */
  public function getFilePath() {
    if (!file_exists($this->file_path)) {
      throw new Exception(t('File @filepath is not accessible.', array(
        '@filepath' => $this->file_path,
      )));
    }
    return $this->file_path;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsBatch::$progress protected property
FeedsBatch::$total protected property
FeedsBatch::getProgress public function Report progress.
FeedsBatch::getTotal public function Get the total for a stage.
FeedsBatch::setProgress public function Set progress for a stage.
FeedsBatch::setTotal public function Set the total for a stage.
FeedsFileBatch::$file_path protected property
FeedsFileBatch::getFilePath public function Implementation of FeedsImportBatch::getFilePath(). Overrides FeedsImportBatch::getFilePath
FeedsFileBatch::getRaw public function Implementation of FeedsImportBatch::getRaw(); Overrides FeedsImportBatch::getRaw
FeedsFileBatch::__construct public function Constructor. Overrides FeedsImportBatch::__construct
FeedsImportBatch::$created public property
FeedsImportBatch::$current_item protected property
FeedsImportBatch::$description public property
FeedsImportBatch::$feed_nid public property
FeedsImportBatch::$items public property
FeedsImportBatch::$link public property
FeedsImportBatch::$raw protected property
FeedsImportBatch::$title public property
FeedsImportBatch::$updated public property
FeedsImportBatch::addItem Deprecated public function Add an item.
FeedsImportBatch::currentItem public function
FeedsImportBatch::feedNode Deprecated public function
FeedsImportBatch::getDescription Deprecated public function
FeedsImportBatch::getItemCount Deprecated public function Get number of items.
FeedsImportBatch::getLink Deprecated public function
FeedsImportBatch::getTitle Deprecated public function
FeedsImportBatch::setDescription Deprecated public function Set description.
FeedsImportBatch::setItems Deprecated public function Set items.
FeedsImportBatch::setLink Deprecated public function Set link.
FeedsImportBatch::setTitle Deprecated public function Set title.
FeedsImportBatch::shiftItem public function @todo Move to a nextItem() based approach, not consuming the item array. Can only be done once we don't cache the entire batch object between page loads for batching anymore.