abstract class FeedImportReader in Feed Import 8
Abstract implementation of reader.
Hierarchy
- class \Drupal\feed_import_base\FeedImportConfigurable- class \Drupal\feed_import_base\FeedImportReader
 
Expanded class hierarchy of FeedImportReader
File
- feed_import_base/src/ FeedImportReader.php, line 7 
Namespace
Drupal\feed_import_baseView source
abstract class FeedImportReader extends FeedImportConfigurable {
  // Used to store items.
  protected $items = array();
  /**
   * Constructor of reader. Constructor is final but you'll have to
   * implement init() to init your reader.
   *
   * @param array $options An array of options to pass to reader
   */
  public final function __construct(array $options = array()) {
    $this
      ->setOptions($options);
  }
  /**
   * Destructor.
   */
  public function __destruct() {
    unset($this->items, $this->options);
  }
  /**
   * Here you'll init your reader.
   */
  public abstract function init();
  /**
   * This method returns the next available item or NULL if there are no items
   * left.
   *
   * @return mixed The read item
   */
  public abstract function get();
  /**
   * Returns a value mapped from obj by path.
   *
   * @param mixed $obj  Variable to search
   * @param mixed $path Path to value
   *
   * @return mixed Mapped value
   */
  public abstract function map(&$obj, &$path);
  /**
   * Override this to preprocess your paths before they are used in map().
   *
   * @param string $path Path to format
   *
   * @return mixed Formatted path
   */
  public function formatPath($path) {
    return $path;
  }
  /**
   * Returns a stream context
   *
   * @param mixed $ctx
   *    Context options
   *
   * @return resource
   *    Stream context or NULL on failure
   */
  public function getStreamContext($ctx) {
    if ($ctx && (is_array($ctx) || is_scalar($ctx) && ($ctx = json_decode($ctx, TRUE)))) {
      return stream_context_create($ctx);
    }
    return NULL;
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| FeedImportConfigurable:: | protected | property | ||
| FeedImportConfigurable:: | public static | function | Helper function to get lines of a string | |
| FeedImportConfigurable:: | public | function | Sets options for this instance | 4 | 
| FeedImportReader:: | protected | property | ||
| FeedImportReader:: | public | function | Override this to preprocess your paths before they are used in map(). | 2 | 
| FeedImportReader:: | abstract public | function | This method returns the next available item or NULL if there are no items left. | 6 | 
| FeedImportReader:: | public | function | Returns a stream context | |
| FeedImportReader:: | abstract public | function | Here you'll init your reader. | 6 | 
| FeedImportReader:: | abstract public | function | Returns a value mapped from obj by path. | 4 | 
| FeedImportReader:: | final public | function | Constructor of reader. Constructor is final but you'll have to implement init() to init your reader. | |
| FeedImportReader:: | public | function | Destructor. | 2 | 
