function LinearHistory::__construct

Same name in other branches
  1. 10 core/lib/Drupal/Core/Config/Checkpoint/LinearHistory.php \Drupal\Core\Config\Checkpoint\LinearHistory::__construct()

Constructs a checkpoints object.

Parameters

\Drupal\Core\State\StateInterface $state: The state service.

\Drupal\Component\Datetime\TimeInterface $time: The time service.

File

core/lib/Drupal/Core/Config/Checkpoint/LinearHistory.php, line 47

Class

LinearHistory
A chronological list of Checkpoint objects.

Namespace

Drupal\Core\Config\Checkpoint

Code

public function __construct(StateInterface $state, TimeInterface $time) {
    $this->checkpoints = $this->state
        ->get(self::CHECKPOINT_KEY, []);
    $this->activeCheckpoint = end($this->checkpoints) ?: NULL;
}

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