ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

49 {
50 $frm_sess = $this->getSessionCollection();
51
52 return $frm_sess[$this->key][$thread_id] ?? $default;
53 }

References getSessionCollection().

+ 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.

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)

References ilSession\get().

Referenced by get(), and set().

+ 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.

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.

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

+ Here is the call graph for this function:

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