function CheckpointStorage::setCheckpointToReadFrom

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php \Drupal\Core\Config\Checkpoint\CheckpointStorage::setCheckpointToReadFrom()

Sets the checkpoint to read from.

Calling read() or readMultiple() will return the configuration data at the time of the checkpoint that was set here. If none is set, then the configuration from the initial checkpoint will be returned.

Parameters

string|\Drupal\Core\Config\Checkpoint\Checkpoint $checkpoint_id: The checkpoint ID to read from.

Return value

$this

Overrides CheckpointStorageInterface::setCheckpointToReadFrom

File

core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php, line 293

Class

CheckpointStorage
Provides a config storage that can make checkpoints.

Namespace

Drupal\Core\Config\Checkpoint

Code

public function setCheckpointToReadFrom(string|Checkpoint $checkpoint_id) : static {
  if ($checkpoint_id instanceof Checkpoint) {
    $checkpoint_id = $checkpoint_id->id;
  }
  $this->readFromCheckpoint = $this->checkpoints
    ->get($checkpoint_id);
  return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.