ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\KioskMode\State Class Reference

Keeps the state of a view in a simple stringly type key-value store. More...

+ Collaboration diagram for ILIAS\KioskMode\State:

Public Member Functions

 withValueFor (string $key, string $value)
 Set a value for a key of the state. More...
 
 withoutKey (string $key)
 Remove the key-value-pair. More...
 
 getValueFor (string $key)
 Get the value for the given key. More...
 
 serialize ()
 Get the key-value store as string. More...
 

Protected Attributes

 $store
 

Detailed Description

Keeps the state of a view in a simple stringly type key-value store.

Definition at line 9 of file State.php.

Member Function Documentation

◆ getValueFor()

ILIAS\KioskMode\State::getValueFor ( string  $key)

Get the value for the given key.

Definition at line 40 of file State.php.

Referenced by StateTest\testValue().

40  : ?string
41  {
42  if (!$this->store) {
43  return null;
44  }
45  return $this->store[$key];
46  }
+ Here is the caller graph for this function:

◆ serialize()

ILIAS\KioskMode\State::serialize ( )

Get the key-value store as string.

Definition at line 51 of file State.php.

Referenced by StateTest\testRemoveValue(), and StateTest\testSerialize().

51  : string
52  {
53  return json_encode($this->store);
54  }
+ Here is the caller graph for this function:

◆ withoutKey()

ILIAS\KioskMode\State::withoutKey ( string  $key)

Remove the key-value-pair.

Definition at line 30 of file State.php.

Referenced by StateTest\testRemoveValue().

30  : State
31  {
32  $clone = clone $this;
33  unset($clone->store[$key]);
34  return $clone;
35  }
+ Here is the caller graph for this function:

◆ withValueFor()

ILIAS\KioskMode\State::withValueFor ( string  $key,
string  $value 
)

Set a value for a key of the state.

Definition at line 20 of file State.php.

Referenced by StateTest\testRemoveValue(), and StateTest\testValue().

20  : State
21  {
22  $clone = clone $this;
23  $clone->store[$key] = $value;
24  return $clone;
25  }
+ Here is the caller graph for this function:

Field Documentation

◆ $store

ILIAS\KioskMode\State::$store
protected

Definition at line 15 of file State.php.


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