ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilForumThreadSettingsSessionStorage Class Reference
+ Collaboration diagram for ilForumThreadSettingsSessionStorage:

Public Member Functions

 __construct (string $session_key)
 
 get (int $thread_id, $default=null)
 
 set (int $thread_id, $value)
 

Private Member Functions

 getSessionCollection ()
 

Private Attributes

string $key
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilForumThreadSettingsSessionStorage::__construct ( string  $session_key)

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

26  {
27  $this->key = $session_key;
28  }

Member Function Documentation

◆ get()

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

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

References $key, and getSessionCollection().

53  {
54  $frm_sess = $this->getSessionCollection();
55 
56  return $frm_sess[$this->key][$thread_id] ?? $default;
57  }
+ Here is the call graph for this function:

◆ getSessionCollection()

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

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

References $key, and ilSession\get().

Referenced by get(), and set().

33  : array
34  {
35  $frm_sess = ilSession::get('frm_sess');
36  if (!is_array($frm_sess)) {
37  $frm_sess = [];
38  }
39 
40  if (!isset($frm_sess[$this->key]) || !is_array($frm_sess[$this->key])) {
41  $frm_sess[$this->key] = [];
42  }
43 
44  return $frm_sess;
45  }
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
int$thread_id
mixed$value

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

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

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

Field Documentation

◆ $key

string ilForumThreadSettingsSessionStorage::$key
private

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

Referenced by get(), getSessionCollection(), and set().


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