ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilForumThreadSettingsSessionStorage Class Reference
+ Collaboration diagram for ilForumThreadSettingsSessionStorage:

Public Member Functions

 __construct (private readonly string $key)
 
 get (int $thread_id, $default=null)
 
 set (int $thread_id, $value)
 

Private Member Functions

 getSessionCollection ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilForumThreadSettingsSessionStorage::__construct ( private readonly string  $key)

Definition at line 23 of file class.ilForumThreadSettingsSessionStorage.php.

24  {
25  }

Member Function Documentation

◆ get()

ilForumThreadSettingsSessionStorage::get ( int  $thread_id,
  $default = null 
)
Parameters
mixed | null$default
Returns
mixed

Definition at line 48 of file class.ilForumThreadSettingsSessionStorage.php.

References getSessionCollection().

49  {
50  $frm_sess = $this->getSessionCollection();
51 
52  return $frm_sess[$this->key][$thread_id] ?? $default;
53  }
+ Here is the call graph for this function:

◆ getSessionCollection()

ilForumThreadSettingsSessionStorage::getSessionCollection ( )
private
Returns
array<string, mixed>

Definition at line 30 of file class.ilForumThreadSettingsSessionStorage.php.

References ilSession\get().

Referenced by get(), and set().

30  : array
31  {
32  $frm_sess = ilSession::get('frm_sess');
33  if (!is_array($frm_sess)) {
34  $frm_sess = [];
35  }
36 
37  if (!isset($frm_sess[$this->key]) || !is_array($frm_sess[$this->key])) {
38  $frm_sess[$this->key] = [];
39  }
40 
41  return $frm_sess;
42  }
static get(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set()

ilForumThreadSettingsSessionStorage::set ( int  $thread_id,
  $value 
)
Parameters
mixed$value

Definition at line 58 of file class.ilForumThreadSettingsSessionStorage.php.

References getSessionCollection(), and ilSession\set().

58  : void
59  {
60  $frm_sess = $this->getSessionCollection();
61 
62  $frm_sess[$this->key][$thread_id] = $value;
63 
64  ilSession::set('frm_sess', $frm_sess);
65  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

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