You are here

public function FeedsSource::state in Feeds 8.2

Return a state object for a given stage. Lazy instantiates new states.

@todo Rename getConfigFor() accordingly to config().

Parameters

$stage: One of FEEDS_FETCH, FEEDS_PARSE, FEEDS_PROCESS or FEEDS_PROCESS_CLEAR.

Return value

The FeedsState object for the given stage.

1 call to FeedsSource::state()
FeedsSource::progressImporting in lib/Drupal/feeds/FeedsSource.php
Report progress as float between 0 and 1. 1 = FEEDS_BATCH_COMPLETE.

File

lib/Drupal/feeds/FeedsSource.php, line 399
Definition of FeedsSourceInterface and FeedsSource class.

Class

FeedsSource
This class encapsulates a source of a feed. It stores where the feed can be found and how to import it.

Namespace

Drupal\feeds

Code

public function state($stage) {
  if (!is_array($this->state)) {
    $this->state = array();
  }
  if (!isset($this->state[$stage])) {
    $this->state[$stage] = new FeedsState();
  }
  return $this->state[$stage];
}