ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo Class Reference
+ Collaboration diagram for ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo:

Public Member Functions

 __construct (?Session $session=null)
 
 set (int $style_id, string $style_type, array $characteristics)
 Set characteristics. More...
 
 getData ()
 
 hasEntries (string $style_type)
 
 clear ()
 

Protected Member Functions

 getValue ()
 

Protected Attributes

const SESSION_KEY = "sty_copy"
 
Session $session
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo::__construct ( ?Session  $session = null)

Definition at line 35 of file class.CharacteristicCopyPasteSessionRepo.php.

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 }
static get(string $a_var)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.

References ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\$session, ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\clear(), ilSession\clear(), ilSession\get(), and ilSession\set().

+ Here is the call graph for this function:

Member Function Documentation

◆ clear()

ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo::clear ( )

Definition at line 93 of file class.CharacteristicCopyPasteSessionRepo.php.

93 : void
94 {
95 $this->session->clear(self::SESSION_KEY);
96 }

Referenced by ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\__construct().

+ Here is the caller graph for this function:

◆ getData()

ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo::getData ( )

Definition at line 66 of file class.CharacteristicCopyPasteSessionRepo.php.

66 : 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 }

References $data, and ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\getValue().

+ Here is the call graph for this function:

◆ getValue()

ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo::getValue ( )
protected

Definition at line 76 of file class.CharacteristicCopyPasteSessionRepo.php.

76 : string
77 {
78 return $this->session->get(self::SESSION_KEY);
79 }

Referenced by ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\getData(), and ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\hasEntries().

+ Here is the caller graph for this function:

◆ hasEntries()

ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo::hasEntries ( string  $style_type)

Definition at line 81 of file class.CharacteristicCopyPasteSessionRepo.php.

81 : 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 }

References ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo\getValue().

+ Here is the call graph for this function:

◆ set()

ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo::set ( int  $style_id,
string  $style_type,
array  $characteristics 
)

Set characteristics.

Definition at line 59 of file class.CharacteristicCopyPasteSessionRepo.php.

59 : 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 }

Field Documentation

◆ $session

Session ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo::$session
protected

◆ SESSION_KEY

const ILIAS\Style\Content\CharacteristicCopyPasteSessionRepo::SESSION_KEY = "sty_copy"
protected

Definition at line 31 of file class.CharacteristicCopyPasteSessionRepo.php.


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