public function Stat8b7c:f320:99b9:690f:4595:cd17:293a:c069getMultiple public Stat8b7c:f320:99b9:690f:4595:cd17:293a:c069getMultiple(array $keys) Returns the stored key/value pairs for a given set of keys. Parameters  array $keys: A list of keys to retrieve. Return value  array An associative array of items successfully returned, indexed by key. Overrides StateInter8b7c:f320:99b9:690f:4595:cd17:293a:c069getMultiple File
 core/lib/Drupal/Core/State/State.php, line 47  Class
 
State  Provides the state system using a key value store.  Namespace Drupal\Core\State Code public function getMultiple(array $keys) {
  $values = array();
  $load = array();
  foreach ($keys as $key) {
    // Check if we have a value in the cache.
    if (isset($this->cache[$key])) {
      $values[$key] = $this->cache[$key];
    }
    // Load the value if we don't have an explicit NULL value.
    elseif (!array_key_exists($key, $this->cache)) {
      $load[] = $key;
    }
  }

  if ($load) {
    $loaded_values = $this->keyValueStore->getMultiple($load);
    foreach ($load as $key) {
      // If we find a value, even one that is NULL, add it to the cache and
      // return it.
      if (isset($loaded_values[$key]) || array_key_exists($key, $loaded_values)) {
        $values[$key] = $loaded_values[$key];
        $this->cache[$key] = $loaded_values[$key];
      }
      else {
        $this->cache[$key] = NULL;
      }
    }
  }

  return $values;
}


    
{'path': 'public/docs/drupal~8/core-lib-drupal-core-state-state.php/function/state-getmultiple/8.1.x.html', 'source': 'DevDocs.IO'}