function State::getValuesSetDuringRequest

Returns any values modified for a given key during the request.

Parameters

string $key: The key to get the values for.

Return value

array{value: mixed, original: mixed}|null An array containing:

  • value: The last value set during the request.
  • original: The initial value at the start of the request.

If $key is not set, NULL is returned.

Overrides StateInterface::getValuesSetDuringRequest

File

core/lib/Drupal/Core/State/State.php, line 156

Class

State
Provides the state system using a key value store.

Namespace

Drupal\Core\State

Code

public function getValuesSetDuringRequest(string $key) : ?array {
  return $this->keysSetDuringRequest[$key] ?? NULL;
}

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