ILIAS
trunk Revision v11.0_alpha-2662-g519ff7d528f
◀ ilDoc Overview
class.CharacteristicCopyPasteSessionRepo.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Style\Content
;
22
23
use
ilSession
;
24
use
stdClass
;
25
29
class
CharacteristicCopyPasteSessionRepo
30
{
31
protected
const
SESSION_KEY
=
"sty_copy"
;
32
33
protected
Session
$session
;
34
35
public
function
__construct
(?
Session
$session =
null
)
36
{
37
$this->session = (
$session
)
38
?:
new
class
() implements
Session
{
39
public
function
set
(
string
$key,
string
$value):
void
40
{
41
ilSession::set
($key, $value);
42
}
43
44
public
function
get
(
string
$key):
string
45
{
46
return
(
string
)
ilSession::get
($key);
47
}
48
49
public
function
clear
(
string
$key):
void
50
{
51
ilSession::clear
($key);
52
}
53
};
54
}
55
59
public
function
set
(
int
$style_id,
string
$style_type, array $characteristics):
void
60
{
61
$style_cp = implode(
"::"
, $characteristics);
62
$style_cp = $style_id .
":::"
. $style_type .
":::"
. $style_cp;
63
$this->session->set(self::SESSION_KEY, $style_cp);
64
}
65
66
public
function
getData
():
stdClass
67
{
68
$st_c = explode(
":::"
, $this->
getValue
());
69
$data
=
new
stdClass
();
70
$data
->style_id = $st_c[0] ?? 0;
71
$data
->style_type = $st_c[1] ??
""
;
72
$data
->characteristics = explode(
"::"
, $st_c[2] ??
""
);
73
return
$data
;
74
}
75
76
protected
function
getValue
(): string
77
{
78
return
$this->session->get(self::SESSION_KEY);
79
}
80
81
public
function
hasEntries
(
string
$style_type): bool
82
{
83
$val = $this->
getValue
();
84
if
($val !=
""
) {
85
$style_cp = explode(
":::"
, $val);
86
if
($style_cp[1] == $style_type) {
87
return
true
;
88
}
89
}
90
return
false
;
91
}
92
93
public
function
clear
(): void
94
{
95
$this->session->clear(self::SESSION_KEY);
96
}
97
}
ilSession\get
static get(string $a_var)
Definition:
class.ilSession.php:388
$data
$data
Definition:
ltiregistration.php:29
ILIAS\Style\Content
ilSession
stdClass
ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\getValue
getValue()
Definition:
class.CharacteristicCopyPasteSessionRepo.php:76
ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\SESSION_KEY
const SESSION_KEY
Definition:
class.CharacteristicCopyPasteSessionRepo.php:31
ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\getData
getData()
Definition:
class.CharacteristicCopyPasteSessionRepo.php:66
ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\hasEntries
hasEntries(string $style_type)
Definition:
class.CharacteristicCopyPasteSessionRepo.php:81
ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo
Definition:
class.CharacteristicCopyPasteSessionRepo.php:29
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:144
ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\$session
Session $session
Definition:
class.CharacteristicCopyPasteSessionRepo.php:33
ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\clear
clear()
Definition:
class.CharacteristicCopyPasteSessionRepo.php:93
ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\__construct
__construct(?Session $session=null)
Definition:
class.CharacteristicCopyPasteSessionRepo.php:35
ILIAS\Style\Content\Session
Wrapper interface for session.
Definition:
interface.Session.php:28
ilSession\clear
static clear(string $a_var)
Definition:
class.ilSession.php:398
ilSession\set
static set(string $a_var, $a_val)
Set a value.
Definition:
class.ilSession.php:380
components
ILIAS
Style
Content
Characteristic
class.CharacteristicCopyPasteSessionRepo.php
Generated on Wed Sep 3 2025 23:03:54 for ILIAS by
1.8.13 (using
Doxyfile
)