function RecipeCommand::rollBackToCheckpoint

Same name in this branch
  1. 11.x core/lib/Drupal/Core/Recipe/RecipeCommand.php \Drupal\Core\Recipe\RecipeCommand::rollBackToCheckpoint()
Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Recipe/RecipeCommand.php \Drupal\Core\Recipe\RecipeCommand::rollBackToCheckpoint()
  2. main core/lib/Drupal/Core/Recipe/RecipeCommand.php \Drupal\Core\Recipe\RecipeCommand::rollBackToCheckpoint()
  3. main core/lib/Drupal/Core/Recipe/Command/RecipeCommand.php \Drupal\Core\Recipe\Command\RecipeCommand::rollBackToCheckpoint()

Rolls config back to a particular checkpoint.

Parameters

\Drupal\Core\Config\Checkpoint\Checkpoint $checkpoint: The checkpoint to roll back to.

1 call to RecipeCommand::rollBackToCheckpoint()
RecipeCommand::execute in core/lib/Drupal/Core/Recipe/Command/RecipeCommand.php

File

core/lib/Drupal/Core/Recipe/Command/RecipeCommand.php, line 160

Class

RecipeCommand
Applies recipe.

Namespace

Drupal\Core\Recipe\Command

Code

private function rollBackToCheckpoint(Checkpoint $checkpoint) : void {
  $container = \Drupal::getContainer();
  $this->checkpoint_storage
    ->setCheckpointToReadFrom($checkpoint);
  assert($this->configStorage instanceof StorageInterface);
  $storage_comparer = new StorageComparer($this->checkpoint_storage, $this->configStorage);
  $storage_comparer->reset();
  $container->get(ConfigImporterFactory::class)
    ->get($storage_comparer)
    ->import();
}

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