ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjNotificationSettings Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilObjNotificationSettings:

Public Member Functions

 __construct (int $a_obj_id)
 
 setMode (int $a_val)
 
 getMode ()
 
 save ()
 
 read ()
 
 delete ()
 

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

int $obj_id
 
int $mode = 0
 
ilDBInterface $db
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Handles general object notification settings, see e.g. https://www.ilias.de/docu/goto_docu_wiki_wpage_3457_1357.html

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

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

Constructor & Destructor Documentation

◆ __construct()

ilObjNotificationSettings::__construct ( int  $a_obj_id)

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

35 {
36 global $DIC;
37
38 $this->obj_id = $a_obj_id;
39 $this->db = $DIC->database();
40 $this->read();
41 }
global $DIC
Definition: shib_login.php:26

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilObjNotificationSettings::delete ( )

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

78 : void
79 {
80 $db = $this->db;
81
82 $db->manipulate("DELETE FROM obj_noti_settings WHERE " .
83 " obj_id = " . $db->quote($this->obj_id, "integer"));
84 }
quote($value, string $type)
manipulate(string $query)
Run a (write) Query on the database.

References $db, ilDBInterface\manipulate(), and ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getMode()

ilObjNotificationSettings::getMode ( )

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

48 : int
49 {
50 return $this->mode;
51 }

References $mode.

Referenced by save().

+ Here is the caller graph for this function:

◆ read()

ilObjNotificationSettings::read ( )

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

66 : void
67 {
68 $db = $this->db;
69
70 $set = $db->query(
71 "SELECT * FROM obj_noti_settings " .
72 " WHERE obj_id = " . $db->quote($this->obj_id, "integer")
73 );
74 $rec = $db->fetchAssoc($set);
75 $this->setMode((int) ($rec["noti_mode"] ?? 0));
76 }
query(string $query)
Run a (read-only) Query on the database.
fetchAssoc(ilDBStatement $statement)

References $db, ilDBInterface\fetchAssoc(), ilDBInterface\query(), ilDBInterface\quote(), and setMode().

Referenced by __construct().

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

◆ save()

ilObjNotificationSettings::save ( )

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

53 : void
54 {
55 $db = $this->db;
56
57 if ($this->obj_id > 0) {
58 $db->replace(
59 "obj_noti_settings",
60 array("obj_id" => array("integer", $this->obj_id)),
61 array("noti_mode" => array("integer", $this->getMode()))
62 );
63 }
64 }
replace(string $table, array $primary_keys, array $other_columns)
Replace into method.

References $db, getMode(), and ilDBInterface\replace().

+ Here is the call graph for this function:

◆ setMode()

ilObjNotificationSettings::setMode ( int  $a_val)

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

43 : void
44 {
45 $this->mode = $a_val;
46 }

Referenced by read().

+ Here is the caller graph for this function:

Field Documentation

◆ $db

ilDBInterface ilObjNotificationSettings::$db
protected

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

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

◆ $mode

int ilObjNotificationSettings::$mode = 0
protected

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

Referenced by getMode().

◆ $obj_id

int ilObjNotificationSettings::$obj_id
protected

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

◆ MODE_DEF_OFF_USER_ACTIVATION

const ilObjNotificationSettings::MODE_DEF_OFF_USER_ACTIVATION = 0

◆ MODE_DEF_ON_NO_OPT_OUT

const ilObjNotificationSettings::MODE_DEF_ON_NO_OPT_OUT = 2

◆ MODE_DEF_ON_OPT_OUT

const ilObjNotificationSettings::MODE_DEF_ON_OPT_OUT = 1

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