ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjTermsOfService.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
9 {
11  protected $db;
12 
14  protected $settings;
15 
20  public function __construct($a_id = 0, $a_reference = true)
21  {
22  global $DIC;
23 
24  parent::__construct($a_id, $a_reference);
25 
26  $this->db = $DIC['ilDB'];
27  $this->settings = $DIC['ilSetting'];
28  }
29 
33  protected function initType()
34  {
35  $this->type = 'tos';
36  }
37 
41  public function resetAll() : void
42  {
43  $in = $this->db->in('usr_id', [ANONYMOUS_USER_ID, SYSTEM_USER_ID], true, 'integer');
44  $this->db->manipulate("UPDATE usr_data SET agree_date = NULL WHERE $in");
45 
46  $this->settings->set('tos_last_reset', time());
47  }
48 
53  public function getLastResetDate() : ilDateTime
54  {
55  return new ilDateTime($this->settings->get('tos_last_reset'), IL_CAL_UNIX);
56  }
57 
61  public function saveStatus(bool $status) : void
62  {
63  ilTermsOfServiceHelper::setStatus((bool) $status);
64  }
65 
69  public function getStatus() : bool
70  {
72  }
73 }
settings()
Definition: settings.php:2
__construct($a_id=0, $a_reference=true)
const IL_CAL_UNIX
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
Class ilObjTermsOfService.