ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjNotificationSettings Class Reference

Handles general object notification settings, see e.g. More...

+ Collaboration diagram for ilObjNotificationSettings:

Public Member Functions

 __construct ($a_obj_id)
 Constructor. More...
 
 setMode ($a_val)
 Set mode. More...
 
 getMode ()
 Get mode. More...
 
 save ()
 Save. More...
 
 read ()
 Read. More...
 
 delete ()
 Delete. More...
 

Data Fields

const MODE_DEF_OFF_USER_ACTIVATION = 0
 
const MODE_DEF_ON_OPT_OUT = 1
 
const MODE_DEF_ON_NO_OPT_OUT = 2
 

Protected Attributes

 $obj_id
 
 $mode = 0
 
 $db
 

Detailed Description

Handles general object notification settings, see e.g.

https://www.ilias.de/docu/goto_docu_wiki_wpage_3457_1357.html

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 12 of file class.ilObjNotificationSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjNotificationSettings::__construct (   $a_obj_id)

Constructor.

Parameters
int$a_obj_idobject id

Definition at line 38 of file class.ilObjNotificationSettings.php.

39 {
40 global $DIC;
41
42 $this->obj_id = $a_obj_id;
43 $this->db = $DIC->database();
44 $this->read();
45 }
global $DIC
Definition: goto.php:24

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilObjNotificationSettings::delete ( )

Delete.

Definition at line 102 of file class.ilObjNotificationSettings.php.

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 }

References $db.

◆ getMode()

ilObjNotificationSettings::getMode ( )

Get mode.

Returns
int mode

Definition at line 62 of file class.ilObjNotificationSettings.php.

References $mode.

Referenced by save().

+ Here is the caller graph for this function:

◆ read()

ilObjNotificationSettings::read ( )

Read.

Definition at line 86 of file class.ilObjNotificationSettings.php.

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 }

References $db, and setMode().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilObjNotificationSettings::save ( )

Save.

Definition at line 70 of file class.ilObjNotificationSettings.php.

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 }

References $db, and getMode().

+ Here is the call graph for this function:

◆ setMode()

ilObjNotificationSettings::setMode (   $a_val)

Set mode.

Parameters
$a_val

Definition at line 52 of file class.ilObjNotificationSettings.php.

53 {
54 $this->mode = $a_val;
55 }

Referenced by read().

+ Here is the caller graph for this function:

Field Documentation

◆ $db

ilObjNotificationSettings::$db
protected

Definition at line 31 of file class.ilObjNotificationSettings.php.

Referenced by delete(), read(), and save().

◆ $mode

ilObjNotificationSettings::$mode = 0
protected

Definition at line 26 of file class.ilObjNotificationSettings.php.

Referenced by getMode().

◆ $obj_id

ilObjNotificationSettings::$obj_id
protected

Definition at line 21 of file class.ilObjNotificationSettings.php.

◆ MODE_DEF_OFF_USER_ACTIVATION

const ilObjNotificationSettings::MODE_DEF_OFF_USER_ACTIVATION = 0

◆ MODE_DEF_ON_NO_OPT_OUT

◆ MODE_DEF_ON_OPT_OUT


The documentation for this class was generated from the following file: