You are here

interface StateInterface in Feeds 8.3

Status of the import or clearing operation of a Feed.

Hierarchy

Expanded class hierarchy of StateInterface

All classes that implement StateInterface

29 files declare their use of StateInterface
CleanStateInterface.php in src/Feeds/State/CleanStateInterface.php
ClearableInterface.php in src/Plugin/Type/ClearableInterface.php
ConfigEntityReference.php in src/Feeds/Target/ConfigEntityReference.php
CsvParser.php in src/Feeds/Parser/CsvParser.php
CsvParserTest.php in tests/src/Unit/Feeds/Parser/CsvParserTest.php

... See full list

File

src/StateInterface.php, line 8

Namespace

Drupal\feeds
View source
interface StateInterface {

  /**
   * Batch operation complete.
   *
   * @var float
   */
  const BATCH_COMPLETE = 1.0;

  /**
   * The start time key.
   *
   * @var string
   */
  const START = 'start_time';

  /**
   * Denotes the fetch stage.
   *
   * @var string
   */
  const FETCH = 'fetch';

  /**
   * Denotes the parse stage.
   *
   * @var string
   */
  const PARSE = 'parse';

  /**
   * Denotes the process stage.
   *
   * @var string
   */
  const PROCESS = 'process';

  /**
   * Denotes the clean stage.
   *
   * @var string
   */
  const CLEAN = 'clean';

  /**
   * Denotes the clear stage.
   *
   * @var string
   */
  const CLEAR = 'clear';

  /**
   * Denotes the expire stage.
   *
   * @var string
   */
  const EXPIRE = 'expire';

  /**
   * Reports the progress of a batch.
   *
   * When $total === $progress, the state of the task tracked by this state is
   * regarded to be complete.
   *
   * Should handle the following cases gracefully:
   * - $total is 0.
   * - $progress is larger than $total.
   * - $progress approximates $total so that $finished rounds to 1.0.
   *
   * @param int $total
   *   A number that is the total to be worked off.
   * @param int $progress
   *   A number that is the progress made on $total.
   */
  public function progress($total, $progress);

  /**
   * Immediately completes the batch.
   */
  public function setCompleted();

  /**
   * Sets a message to display to the user.
   *
   * This should be used by plugins instead of the Drupal messenger service. It
   * will store messages and display them at the appropriate time.
   *
   * @param string $message
   *   (optional) The translated message to be displayed to the user. For
   *   consistency with other messages, it should begin with a capital letter
   *   and end with a period.
   * @param string $type
   *   (optional) The message's type. Defaults to 'status'. These values are
   *   supported:
   *   - 'status'
   *   - 'warning'
   *   - 'error'.
   * @param bool $repeat
   *   (optional) If this is FALSE and the message is already set, then the
   *   message won't be repeated. Defaults to FALSE.
   *
   * @see \Drupal\Core\Messenger\MessengerInterface::addMessage()
   */
  public function setMessage($message = NULL, $type = 'status', $repeat = FALSE);

  /**
   * Shows the messages to the user.
   *
   * @see \Drupal\feeds\StateInterface::setMessage()
   */
  public function displayMessages();

  /**
   * Logs all messages.
   *
   * @param \Drupal\feeds\FeedInterface $feed
   *   The feed to log messages for.
   *
   * @see \Drupal\feeds\StateInterface::setMessage()
   */
  public function logMessages(FeedInterface $feed);

}

Members

Namesort descending Modifiers Type Description Overrides
StateInterface::BATCH_COMPLETE constant Batch operation complete.
StateInterface::CLEAN constant Denotes the clean stage.
StateInterface::CLEAR constant Denotes the clear stage.
StateInterface::displayMessages public function Shows the messages to the user. 1
StateInterface::EXPIRE constant Denotes the expire stage.
StateInterface::FETCH constant Denotes the fetch stage.
StateInterface::logMessages public function Logs all messages. 1
StateInterface::PARSE constant Denotes the parse stage.
StateInterface::PROCESS constant Denotes the process stage.
StateInterface::progress public function Reports the progress of a batch. 1
StateInterface::setCompleted public function Immediately completes the batch. 1
StateInterface::setMessage public function Sets a message to display to the user. 1
StateInterface::START constant The start time key.