ILIAS  release_8 Revision v8.24
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 21 of file class.ilObjNotificationSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjNotificationSettings::__construct ( int  $a_obj_id)

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

32 {
33 global $DIC;
34
35 $this->obj_id = $a_obj_id;
36 $this->db = $DIC->database();
37 $this->read();
38 }
global $DIC
Definition: feed.php:28

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilObjNotificationSettings::delete ( )

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

75 : void
76 {
77 $db = $this->db;
78
79 $db->manipulate("DELETE FROM obj_noti_settings WHERE " .
80 " obj_id = " . $db->quote($this->obj_id, "integer"));
81 }
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 45 of file class.ilObjNotificationSettings.php.

45 : int
46 {
47 return $this->mode;
48 }

References $mode.

Referenced by save().

+ Here is the caller graph for this function:

◆ read()

ilObjNotificationSettings::read ( )

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

63 : void
64 {
65 $db = $this->db;
66
67 $set = $db->query(
68 "SELECT * FROM obj_noti_settings " .
69 " WHERE obj_id = " . $db->quote($this->obj_id, "integer")
70 );
71 $rec = $db->fetchAssoc($set);
72 $this->setMode((int) ($rec["noti_mode"] ?? 0));
73 }
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 50 of file class.ilObjNotificationSettings.php.

50 : void
51 {
52 $db = $this->db;
53
54 if ($this->obj_id > 0) {
55 $db->replace(
56 "obj_noti_settings",
57 array("obj_id" => array("integer", $this->obj_id)),
58 array("noti_mode" => array("integer", $this->getMode()))
59 );
60 }
61 }
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 40 of file class.ilObjNotificationSettings.php.

40 : void
41 {
42 $this->mode = $a_val;
43 }

Referenced by read().

+ Here is the caller graph for this function:

Field Documentation

◆ $db

ilDBInterface ilObjNotificationSettings::$db
protected

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

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

◆ $mode

int ilObjNotificationSettings::$mode = 0
protected

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

Referenced by getMode().

◆ $obj_id

int ilObjNotificationSettings::$obj_id
protected

Definition at line 27 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: