You are here

class FeedsParserResult in Feeds 8.2

A result of a parsing stage.

Hierarchy

Expanded class hierarchy of FeedsParserResult

10 files declare their use of FeedsParserResult
FeedsCSVParser.php in lib/Drupal/feeds/Plugin/feeds/parser/FeedsCSVParser.php
Contains the FeedsCSVParser class.
FeedsNodeProcessor.php in lib/Drupal/feeds/Plugin/feeds/processor/FeedsNodeProcessor.php
Contains \Drupal\feeds\Plugin\feeds\fetcher\FeedsNodeProcessor.
FeedsParser.php in lib/Drupal/feeds/Plugin/FeedsParser.php
Contains FeedsParser and related classes.
FeedsProcessor.php in lib/Drupal/feeds/Plugin/FeedsProcessor.php
Contains FeedsProcessor and related classes.
FeedsSimplePieParser.php in lib/Drupal/feeds/Plugin/feeds/parser/FeedsSimplePieParser.php
Contains FeedsSimplePieParser and related classes.

... See full list

File

lib/Drupal/feeds/FeedsParserResult.php, line 8

Namespace

Drupal\feeds
View source
class FeedsParserResult extends FeedsResult {
  public $title;
  public $description;
  public $link;
  public $items;
  public $current_item;

  /**
   * Constructor.
   */
  public function __construct($items = array()) {
    $this->title = '';
    $this->description = '';
    $this->link = '';
    $this->items = $items;
  }

  /**
   * @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.
   *
   * @return
   *   Next available item or NULL if there is none. Every returned item is
   *   removed from the internal array.
   */
  public function shiftItem() {
    $this->current_item = array_shift($this->items);
    return $this->current_item;
  }

  /**
   * @return
   *   Current result item.
   */
  public function currentItem() {
    return empty($this->current_item) ? NULL : $this->current_item;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsParserResult::$current_item public property
FeedsParserResult::$description public property
FeedsParserResult::$items public property
FeedsParserResult::$link public property
FeedsParserResult::$title public property
FeedsParserResult::currentItem public function
FeedsParserResult::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.
FeedsParserResult::__construct public function Constructor.