ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjTermsOfService.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Object/classes/class.ilObject2.php';
5require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
6
12{
16 protected $db;
17
21 protected $settings;
22
27 public function __construct($a_id = 0, $a_reference = true)
28 {
29 global $DIC;
30
31 parent::__construct($a_id, $a_reference);
32
33 $this->db = $DIC['ilDB'];
34 $this->settings = $DIC['ilSetting'];
35 }
36
40 protected function initType()
41 {
42 $this->type = 'tos';
43 }
44
48 public function resetAll()
49 {
50 $in = $this->db->in('usr_id', array(ANONYMOUS_USER_ID, SYSTEM_USER_ID), true, 'integer');
51 $this->db->manipulate("UPDATE usr_data SET agree_date = NULL WHERE $in");
52
53 $this->settings->set('tos_last_reset', time());
54 }
55
59 public function getLastResetDate()
60 {
61 return new ilDateTime($this->settings->get('tos_last_reset'), IL_CAL_UNIX);
62 }
63
67 public function saveStatus($status)
68 {
70 }
71
75 public function getStatus()
76 {
78 }
79}
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
@classDescription Date and time handling
__construct($a_id=0, $a_reference=true)
Class ilObject2 This is an intermediate progress of ilObject class.
settings()
Definition: settings.php:2
global $DIC