public static function Drupal::state

Returns the state storage service.

Use this to store machine-generated data, local to a specific environment that does not need deploying and does not need human editing; for example, the last time cron was run. Data which needs to be edited by humans and needs to be the same across development, production, etc. environments (for example, the system maintenance message) should use config() instead.

Return value

\Drupal\Core\KeyValueStore\KeyValueStoreInterface

7 calls to Drupal::state()
Field::delete in drupal/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php
Implements \Drupal\Core\Entity\EntityInterface::delete().
FieldInstance::delete in drupal/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php
Overrides \Drupal\Core\Entity\Entity::delete().
field_purge_field in drupal/core/modules/field/field.crud.inc
Purges a field record from the database.
field_purge_instance in drupal/core/modules/field/field.crud.inc
Purges a field instance record from the database.
field_sync_field_status in drupal/core/modules/field/field.module
Refreshes the 'active' and 'storage[active]' values for fields.

... See full list

File

drupal/core/lib/Drupal.php, line 274
Contains Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function state() {
  return static::$container
    ->get('state');
}