You are here

private function ContentHubReindex::setReindexingState in Acquia Content Hub 8

Sets a new Reindexing State.

Parameters

string $new_state: The new Reindexing State.

Return value

string The new state, if it was successfully set, the previous state otherwise.

4 calls to ContentHubReindex::setReindexingState()
ContentHubReindex::setReindexStateFailed in src/Controller/ContentHubReindex.php
Sets the Reindexing State as REINDEX_FAILED.
ContentHubReindex::setReindexStateFinished in src/Controller/ContentHubReindex.php
Sets the Reindexing State as REINDEX_FINISHED.
ContentHubReindex::setReindexStateNone in src/Controller/ContentHubReindex.php
Sets the Reindexing State as REINDEX_NONE.
ContentHubReindex::setReindexStateSent in src/Controller/ContentHubReindex.php
Sets the Reindexing State as REINDEX_SENT.

File

src/Controller/ContentHubReindex.php, line 99

Class

ContentHubReindex
Class for reindexing Content Hub content.

Namespace

Drupal\acquia_contenthub\Controller

Code

private function setReindexingState($new_state) {
  if (in_array($new_state, [
    self::REINDEX_NONE,
    self::REINDEX_SENT,
    self::REINDEX_FAILED,
    self::REINDEX_FINISHED,
  ])) {
    $this->reindexState = $new_state;
    $this->state
      ->set(self::REINDEXING_STATE, $this->reindexState);
  }
  return $this->reindexState;
}