ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.FlashcardSessionArrayRepository.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27{
28 protected array $session = [];
29
30 public function __construct()
31 {
32 }
33
34 public function setInitialTerms(int $glo_id, int $user_id, int $box_nr, array $initial_terms): void
35 {
36 $key = self::KEY_BASE . $glo_id . "_" . $user_id . "_" . $box_nr . "_initial_terms";
37 $this->session[$key] = $initial_terms;
38 }
39
43 public function getInitialTerms(int $glo_id, int $user_id, int $box_nr): array
44 {
45 $key = self::KEY_BASE . $glo_id . "_" . $user_id . "_" . $box_nr . "_initial_terms";
46 if (isset($this->session[$key])) {
47 return $this->session[$key];
48 }
49 return [];
50 }
51
52 public function setTerms(int $glo_id, int $user_id, int $box_nr, array $terms): void
53 {
54 $key = self::KEY_BASE . $glo_id . "_" . $user_id . "_" . $box_nr . "_terms";
55 $this->session[$key] = $terms;
56 }
57
61 public function getTerms(int $glo_id, int $user_id, int $box_nr): array
62 {
63 $key = self::KEY_BASE . $glo_id . "_" . $user_id . "_" . $box_nr . "_terms";
64 if (isset($this->session[$key])) {
65 return $this->session[$key];
66 }
67 return [];
68 }
69}
setTerms(int $glo_id, int $user_id, int $box_nr, array $terms)
setInitialTerms(int $glo_id, int $user_id, int $box_nr, array $initial_terms)