You are here

class FeedsFileFetcherResult in Feeds 8.2

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

Hierarchy

Expanded class hierarchy of FeedsFileFetcherResult

1 file declares its use of FeedsFileFetcherResult
FeedsFileFetcher.php in lib/Drupal/feeds/Plugin/feeds/fetcher/FeedsFileFetcher.php
Home of the FeedsFileFetcher and related classes.

File

lib/Drupal/feeds/FeedsFileFetcherResult.php, line 16
Home of the FeedsFileFetcher and related classes.

Namespace

Drupal\feeds
View source
class FeedsFileFetcherResult extends FeedsFetcherResult {

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

  /**
   * Overrides parent::getRaw().
   */
  public function getRaw() {
    return $this
      ->sanitizeRaw(file_get_contents($this->file_path));
  }

  /**
   * Overrides parent::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
      ->sanitizeFile($this->file_path);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsFetcherResult::$file_path protected property 1
FeedsFetcherResult::$raw protected property
FeedsFetcherResult::sanitizeFile public function Sanitize the file in place. Currently supported sanitizations:
FeedsFetcherResult::sanitizeRaw public function Sanitize the raw content string. Currently supported sanitizations:
FeedsFileFetcherResult::getFilePath public function Overrides parent::getFilePath(). Overrides FeedsFetcherResult::getFilePath
FeedsFileFetcherResult::getRaw public function Overrides parent::getRaw(). Overrides FeedsFetcherResult::getRaw
FeedsFileFetcherResult::__construct public function Constructor. Overrides FeedsFetcherResult::__construct