ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilObjNotificationSettings.php
Go to the documentation of this file.
1
<?
php
2
3
/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12
class
ilObjNotificationSettings
13
{
14
const
MODE_DEF_OFF_USER_ACTIVATION
= 0;
15
const
MODE_DEF_ON_OPT_OUT
= 1;
16
const
MODE_DEF_ON_NO_OPT_OUT
= 2;
17
21
protected
$obj_id
;
22
26
protected
$mode
= 0;
27
31
protected
$db
;
32
38
public
function
__construct
($a_obj_id)
39
{
40
global
$DIC
;
41
42
$this->obj_id = $a_obj_id;
43
$this->db = $DIC->database();
44
$this->
read
();
45
}
46
52
public
function
setMode
($a_val)
53
{
54
$this->mode = $a_val;
55
}
56
62
public
function
getMode
()
63
{
64
return
$this->mode
;
65
}
66
70
public
function
save
()
71
{
72
$db
=
$this->db
;
73
74
if
($this->obj_id > 0) {
75
$db
->replace(
76
"obj_noti_settings"
,
77
array(
"obj_id"
=> array(
"integer"
, $this->obj_id)),
78
array(
"noti_mode"
=> array(
"integer"
, (
int
) $this->
getMode
()))
79
);
80
}
81
}
82
86
public
function
read
()
87
{
88
$db
=
$this->db
;
89
90
$set =
$db
->query(
91
"SELECT * FROM obj_noti_settings "
.
92
" WHERE obj_id = "
.
$db
->quote($this->obj_id,
"integer"
)
93
);
94
$rec =
$db
->fetchAssoc($set);
95
$this->
setMode
((
int
) $rec[
"noti_mode"
]);
96
}
97
98
102
public
function
delete
()
103
{
104
$db
=
$this->db
;
105
106
$db
->manipulate(
"DELETE FROM obj_noti_settings WHERE "
.
107
" obj_id = "
.
$db
->quote($this->obj_id,
"integer"
));
108
}
109
}
ilObjNotificationSettings\getMode
getMode()
Get mode.
Definition:
class.ilObjNotificationSettings.php:62
ilObjNotificationSettings\$mode
$mode
Definition:
class.ilObjNotificationSettings.php:26
$DIC
global $DIC
Definition:
saml.php:7
ilObjNotificationSettings
Handles general object notification settings, see e.g.
Definition:
class.ilObjNotificationSettings.php:12
ilObjNotificationSettings\setMode
setMode($a_val)
Set mode.
Definition:
class.ilObjNotificationSettings.php:52
ilObjNotificationSettings\MODE_DEF_ON_OPT_OUT
const MODE_DEF_ON_OPT_OUT
Definition:
class.ilObjNotificationSettings.php:15
ilObjNotificationSettings\save
save()
Save.
Definition:
class.ilObjNotificationSettings.php:70
ilObjNotificationSettings\$db
$db
Definition:
class.ilObjNotificationSettings.php:31
ilObjNotificationSettings\MODE_DEF_OFF_USER_ACTIVATION
const MODE_DEF_OFF_USER_ACTIVATION
Definition:
class.ilObjNotificationSettings.php:14
ilObjNotificationSettings\__construct
__construct($a_obj_id)
Constructor.
Definition:
class.ilObjNotificationSettings.php:38
php
ilObjNotificationSettings\$obj_id
$obj_id
Definition:
class.ilObjNotificationSettings.php:21
ilObjNotificationSettings\MODE_DEF_ON_NO_OPT_OUT
const MODE_DEF_ON_NO_OPT_OUT
Definition:
class.ilObjNotificationSettings.php:16
ilObjNotificationSettings\read
read()
Read.
Definition:
class.ilObjNotificationSettings.php:86
Services
Notification
classes
class.ilObjNotificationSettings.php
Generated on Thu Jan 16 2025 19:02:26 for ILIAS by
1.8.13 (using
Doxyfile
)