Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. State.php

function State::get

Overrides CacheCollector::get

1 call to State::get()
State::getMultiple in core/lib/Drupal/Core/State/State.php
Returns the stored key/value pairs for a given set of keys.

File

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

Class

State
Provides the state system using a key value store.

Namespace

Drupal\Core\State

Code

public function get($key, $default = NULL) {
    // If the caller is asking for the value of a deprecated state, trigger a
    // deprecation message about it.
    if (isset(self::$deprecatedState[$key])) {
        // phpcs:ignore Drupal.Semantics.FunctionTriggerError
        @trigger_error(self::$deprecatedState[$key]['message'], E_USER_DEPRECATED);
        $key = self::$deprecatedState[$key]['replacement'];
    }
    return parent::get($key) ?? $default;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal