ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilClassificationSessionRepository Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilClassificationSessionRepository:

Public Member Functions

 __construct (int $base_ref_id)
 
 unsetAll ()
 
 unsetValueForProvider (string $provider)
 
 isEmpty ()
 
 getValueForProvider (string $provider)
 
 setValueForProvider (string $provider, array $value)
 

Data Fields

const BASE_SESSION_KEY = 'clsfct'
 

Protected Attributes

string $key
 
int $base_ref_id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too. If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Repos for classification session data

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 20 of file class.ilClassificationSessionRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ilClassificationSessionRepository::__construct ( int  $base_ref_id)

Definition at line 27 of file class.ilClassificationSessionRepository.php.

References $base_ref_id.

28  {
29  $this->base_ref_id = $base_ref_id;
30  $this->key = self::BASE_SESSION_KEY . "_" . $base_ref_id;
31  }

Member Function Documentation

◆ getValueForProvider()

ilClassificationSessionRepository::getValueForProvider ( string  $provider)

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

References $provider, ilSession\get(), and ilSession\has().

Referenced by ClassificationSessionRepositoryTest\testUnsetAll(), ClassificationSessionRepositoryTest\testUnsetValueForProvider(), and ClassificationSessionRepositoryTest\testValueForProvider().

52  : array
53  {
54  if (ilSession::has($this->key)) {
55  $vals = ilSession::get($this->key);
56  return $vals[$provider] ?? [];
57  }
58  return [];
59  }
static get(string $a_var)
$provider
Definition: ltitoken.php:83
static has($a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isEmpty()

ilClassificationSessionRepository::isEmpty ( )

Definition at line 47 of file class.ilClassificationSessionRepository.php.

References ilSession\has().

47  : bool
48  {
49  return !ilSession::has($this->key);
50  }
static has($a_var)
+ Here is the call graph for this function:

◆ setValueForProvider()

ilClassificationSessionRepository::setValueForProvider ( string  $provider,
array  $value 
)

Definition at line 61 of file class.ilClassificationSessionRepository.php.

References $provider, ilSession\get(), ilSession\has(), and ilSession\set().

Referenced by ClassificationSessionRepositoryTest\testUnsetAll(), ClassificationSessionRepositoryTest\testUnsetValueForProvider(), and ClassificationSessionRepositoryTest\testValueForProvider().

61  : void
62  {
63  $vals = [];
64  if (ilSession::has($this->key)) {
65  $vals = ilSession::get($this->key);
66  }
67  $vals[$provider] = $value;
68  ilSession::set($this->key, $vals);
69  }
static get(string $a_var)
$provider
Definition: ltitoken.php:83
static has($a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unsetAll()

ilClassificationSessionRepository::unsetAll ( )

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

References ilSession\clear().

Referenced by ClassificationSessionRepositoryTest\testUnsetAll().

33  : void
34  {
35  ilSession::clear($this->key);
36  }
static clear(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unsetValueForProvider()

ilClassificationSessionRepository::unsetValueForProvider ( string  $provider)

Definition at line 38 of file class.ilClassificationSessionRepository.php.

References ilSession\get(), ilSession\has(), and ilSession\set().

Referenced by ClassificationSessionRepositoryTest\testUnsetValueForProvider().

38  : void
39  {
40  if (ilSession::has($this->key)) {
41  $vals = ilSession::get($this->key);
42  unset($vals[$provider]);
43  ilSession::set($this->key, $vals);
44  }
45  }
static get(string $a_var)
$provider
Definition: ltitoken.php:83
static has($a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $base_ref_id

int ilClassificationSessionRepository::$base_ref_id
protected

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

Referenced by __construct().

◆ $key

string ilClassificationSessionRepository::$key
protected

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

◆ BASE_SESSION_KEY

const ilClassificationSessionRepository::BASE_SESSION_KEY = 'clsfct'

Definition at line 22 of file class.ilClassificationSessionRepository.php.


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