You are here

abstract class FeedsBatchBase in Feeds 8.3

Base class for batched feeds tasks.

Hierarchy

Expanded class hierarchy of FeedsBatchBase

File

src/FeedsBatchBase.php, line 8

Namespace

Drupal\feeds
View source
abstract class FeedsBatchBase implements FeedsBatchInterface {

  /**
   * The Feeds executable.
   *
   * @var \Drupal\feeds\FeedsExecutableInterface
   */
  protected $executable;

  /**
   * The feed to run a batch for.
   *
   * @var \Drupal\feeds\FeedInterface
   */
  protected $feed;

  /**
   * The stage of the batch to run.
   *
   * @var string
   */
  protected $stage;

  /**
   * A list of operations to run.
   *
   * @var array
   */
  protected $operations = [];

  /**
   * Constructs a new FeedsBatchBase object.
   *
   * @param \Drupal\feeds\FeedsExecutableInterface $executable
   *   The Feeds executable.
   * @param \Drupal\feeds\FeedInterface $feed
   *   The feed to run a batch for.
   * @param string $stage
   *   The stage of the batch to run.
   */
  public function __construct(FeedsExecutableInterface $executable, FeedInterface $feed, $stage) {
    $this->executable = $executable;
    $this->feed = $feed;
    $this->stage = $stage;
  }

  /**
   * {@inheritdoc}
   */
  public function addOperation($stage, array $params = []) {
    $this->operations[] = [
      'stage' => $stage,
      'params' => $params,
    ];
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsBatchBase::$executable protected property The Feeds executable.
FeedsBatchBase::$feed protected property The feed to run a batch for.
FeedsBatchBase::$operations protected property A list of operations to run.
FeedsBatchBase::$stage protected property The stage of the batch to run.
FeedsBatchBase::addOperation public function Adds an operation. Overrides FeedsBatchInterface::addOperation
FeedsBatchBase::__construct public function Constructs a new FeedsBatchBase object. 1
FeedsBatchInterface::run public function Runs the batch. 3