You are here

class FeedsFileBatch in Feeds 7

Same name and namespace in other branches
  1. 6 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 {

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

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

  /**
   * Implements 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::getFilePath public function Implements FeedsImportBatch::getFilePath(). Overrides FeedsImportBatch::getFilePath
FeedsFileBatch::getRaw public function Implements FeedsImportBatch::getRaw(); Overrides FeedsImportBatch::getRaw
FeedsFileBatch::__construct public function Constructor. Overrides FeedsImportBatch::__construct
FeedsImportBatch::$created public property
FeedsImportBatch::$current_item protected property
FeedsImportBatch::$description protected property
FeedsImportBatch::$feed_nid protected property
FeedsImportBatch::$file_path protected property 1
FeedsImportBatch::$items protected property
FeedsImportBatch::$link protected property
FeedsImportBatch::$raw protected property
FeedsImportBatch::$title protected property
FeedsImportBatch::$updated public property
FeedsImportBatch::addItem public function Add an item.
FeedsImportBatch::currentItem public function
FeedsImportBatch::feedNode public function Return the feed node related to this batch object.
FeedsImportBatch::getDescription public function
FeedsImportBatch::getItemCount public function Get number of items.
FeedsImportBatch::getLink public function
FeedsImportBatch::getTitle public function
FeedsImportBatch::setDescription public function Set description.
FeedsImportBatch::setItems public function Set items.
FeedsImportBatch::setLink public function Set link.
FeedsImportBatch::setTitle 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.