ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.AwarenessSessionRepository.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Awareness;
22 
27 {
28  public const KEY_BASE = "awrn_";
29 
30  public function __construct()
31  {
32  }
33 
34  public function setOnlineUsersTS(string $ts): void
35  {
36  \ilSession::set(self::KEY_BASE . "_online_users_ts", $ts);
37  }
38 
39  public function getOnlineUsersTS(): string
40  {
41  if (\ilSession::has(self::KEY_BASE . "_online_users_ts")) {
42  return \ilSession::get(self::KEY_BASE . "_online_users_ts");
43  }
44  return "";
45  }
46 
47  public function setLastUpdate(int $val): void
48  {
49  $key = self::KEY_BASE . "last_update";
50  \ilSession::set($key, (string) $val);
51  }
52 
53  public function getLastUpdate(): int
54  {
55  $key = self::KEY_BASE . "last_update";
56  if (\ilSession::has($key)) {
57  return (int) \ilSession::get($key);
58  }
59  return 0;
60  }
61 
62  public function setCount(int $val): void
63  {
64  $key = self::KEY_BASE . "cnt";
65  \ilSession::set($key, (string) $val);
66  }
67 
68  public function getCount(): int
69  {
70  $key = self::KEY_BASE . "cnt";
71  if (\ilSession::has($key)) {
72  return (int) \ilSession::get($key);
73  }
74  return 0;
75  }
76 
77  public function setHighlightCount(int $val): void
78  {
79  $key = self::KEY_BASE . "hcnt";
80  \ilSession::set($key, (string) $val);
81  }
82 
83  public function getHighlightCount(): int
84  {
85  $key = self::KEY_BASE . "hcnt";
86  if (\ilSession::has($key)) {
87  return (int) \ilSession::get($key);
88  }
89  return 0;
90  }
91 }
static get(string $a_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
get(string $class_name)
static has($a_var)
static set(string $a_var, $a_val)
Set a value.