Drupal 8  8.0.2
StateInterface Interface Reference
Inheritance diagram for StateInterface:

Public Member Functions

 get ($key, $default=NULL)
 getMultiple (array $keys)
 set ($key, $value)
 setMultiple (array $data)
 delete ($key)
 deleteMultiple (array $keys)
 resetCache ()

Detailed Description

Defines the interface for the state system.

Member Function Documentation

delete (   $key)

Deletes an item.

string$keyThe item name to delete.

Implemented in State.

deleteMultiple ( array  $keys)

Deletes multiple items.

array$keysA list of item names to delete.

Implemented in State.

get (   $key,
  $default = NULL 

Returns the stored value for a given key.

string$keyThe key of the data to retrieve.
mixed$defaultThe default value to use if the key is not found.
mixed The stored value, or NULL if no value exists.

Implemented in State.

getMultiple ( array  $keys)

Returns the stored key/value pairs for a given set of keys.

array$keysA list of keys to retrieve.
array An associative array of items successfully returned, indexed by key.

Implemented in State.

resetCache ( )

Resets the static cache.

This is mainly used in testing environments.

Implemented in State.

set (   $key,

Saves a value for a given key.

string$keyThe key of the data to store.
mixed$valueThe data to store.

Implemented in State.

setMultiple ( array  $data)

Saves key/value pairs.

array$dataAn associative array of key/value pairs.

Implemented in State.

The documentation for this interface was generated from the following file: