ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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

array $store = null
 

Detailed Description

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

Definition at line 26 of file State.php.

Member Function Documentation

◆ getValueFor()

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

Get the value for the given key.

Definition at line 56 of file State.php.

References null.

Referenced by ilLearningModuleKioskModeView\buildControls(), ilLearningModuleKioskModeView\render(), and StateTest\testValue().

56  : ?string
57  {
58  if (!$this->store) {
59  return null;
60  }
61  return $this->store[$key];
62  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ serialize()

ILIAS\KioskMode\State::serialize ( )

Get the key-value store as string.

Definition at line 67 of file State.php.

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

67  : string
68  {
69  return json_encode($this->store, JSON_THROW_ON_ERROR);
70  }
+ Here is the caller graph for this function:

◆ withoutKey()

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

Remove the key-value-pair.

Definition at line 46 of file State.php.

Referenced by StateTest\testRemoveValue().

46  : State
47  {
48  $clone = clone $this;
49  unset($clone->store[$key]);
50  return $clone;
51  }
+ 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 36 of file State.php.

Referenced by ilLearningModuleKioskModeView\buildInitialState(), StateTest\testRemoveValue(), StateTest\testValue(), and ilLearningModuleKioskModeView\updateGet().

36  : State
37  {
38  $clone = clone $this;
39  $clone->store[$key] = $value;
40  return $clone;
41  }
+ Here is the caller graph for this function:

Field Documentation

◆ $store

array ILIAS\KioskMode\State::$store = null
protected

Definition at line 31 of file State.php.


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