function CheckpointStorage::exists

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

File

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

Class

CheckpointStorage
Provides a config storage that can make checkpoints.

Namespace

Drupal\Core\Config\Checkpoint

Code

public function exists($name) {
    if (count($this->checkpoints) === 0) {
        throw new NoCheckpointsException();
    }
    foreach ($this->getCheckpointsToReadFrom() as $checkpoint) {
        $in_checkpoint = $this->getKeyValue($checkpoint->id, $this->collection)
            ->get($name);
        if ($in_checkpoint !== NULL) {
            // If $in_checkpoint is FALSE then the configuration has been deleted.
            return $in_checkpoint !== FALSE;
        }
    }
    return $this->activeStorage
        ->exists($name);
}

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