ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

References $DIC, and read().

39  {
40  global $DIC;
41 
42  $this->obj_id = $a_obj_id;
43  $this->db = $DIC->database();
44  $this->read();
45  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilObjNotificationSettings::delete ( )

Delete.

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

References $db.

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  }

◆ 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.

References $db, and setMode().

Referenced by __construct().

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  }
+ 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.

References $db, array, and getMode().

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  }
Create styles array
The data for the language used.
+ 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.

Referenced by read().

53  {
54  $this->mode = $a_val;
55  }
+ 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: