ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Notifications\ilNotificationSetupHelper Class Reference
+ Collaboration diagram for ILIAS\Notifications\ilNotificationSetupHelper:

Static Public Member Functions

static setupTables ()
 
static registerChannel (ilDBInterface $db, string $name, string $title, string $description, string $class, string $classfile, string $config_type='set_by_user')
 
static registerType (ilDBInterface $db, string $name, string $title, string $description, string $notification_group, string $config_type='set_by_user')
 

Static Public Attributes

static string $tbl_userconfig = 'notification_usercfg'
 
static string $tbl_userlistener = 'notification_listener'
 
static string $tbl_notification_data = 'notification_data'
 
static string $tbl_notification_queue = 'notification_queue'
 
static string $tbl_notification_osd_handler = 'notification_osd'
 
static string $tbl_notification_channels = 'notification_channels'
 
static string $tbl_notification_types = 'notification_types'
 

Detailed Description

Member Function Documentation

◆ registerChannel()

static ILIAS\Notifications\ilNotificationSetupHelper::registerChannel ( ilDBInterface  $db,
string  $name,
string  $title,
string  $description,
string  $class,
string  $classfile,
string  $config_type = 'set_by_user' 
)
static

Definition at line 150 of file ilNotificationSetupHelper.php.

158 : void {
160 $db,
161 $name,
162 $title,
163 $description,
164 $class,
165 $classfile,
166 $config_type
167 );
168 }
static registerChannel(ilDBInterface $db, string $name, string $title, string $description, string $class, string $classfile, string $config_type)

Referenced by ILIAS\Notifications\ilNotificationSetupHelper\setupTables().

+ Here is the caller graph for this function:

◆ registerType()

static ILIAS\Notifications\ilNotificationSetupHelper::registerType ( ilDBInterface  $db,
string  $name,
string  $title,
string  $description,
string  $notification_group,
string  $config_type = 'set_by_user' 
)
static

Definition at line 170 of file ilNotificationSetupHelper.php.

177 : void {
179 $db,
180 $name,
181 $title,
182 $description,
183 $notification_group,
184 $config_type
185 );
186 }
static registerType(ilDBInterface $db, string $name, string $title, string $description, string $notification_group, string $config_type)

Referenced by ILIAS\Notifications\ilNotificationSetupHelper\setupTables().

+ Here is the caller graph for this function:

◆ setupTables()

static ILIAS\Notifications\ilNotificationSetupHelper::setupTables ( )
static

Definition at line 39 of file ilNotificationSetupHelper.php.

39 : void
40 {
41 global $DIC;
42
43 $ilDB = $DIC->database();
44
45 if (!$ilDB->tableExists(self::$tbl_userconfig)) {
46 $fields = [
47 'usr_id' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
48 'module' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
49 'channel' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
50 ];
51 $ilDB->createTable(self::$tbl_userconfig, $fields);
52 $ilDB->addPrimaryKey(self::$tbl_userconfig, ['usr_id', 'module', 'channel']);
53 }
54
55 if (!$ilDB->tableExists(self::$tbl_userlistener)) {
56 $fields = [
57 'usr_id' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
58 'module' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
59 'sender_id' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
60 'disabled' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 1],
61 ];
62 $ilDB->createTable(self::$tbl_userlistener, $fields);
63 $ilDB->addPrimaryKey(self::$tbl_userlistener, ['usr_id', 'module', 'sender_id']);
64 }
65
66 if (!$ilDB->tableExists(self::$tbl_notification_data)) {
67 $fields = [
68 'notification_id' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
69 'serialized' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 4000],
70 ];
71 $ilDB->createTable(self::$tbl_notification_data, $fields);
72 $ilDB->addPrimaryKey(self::$tbl_notification_data, ['notification_id']);
73
74 $ilDB->createSequence(self::$tbl_notification_data);
75 }
76
77 if (!$ilDB->tableExists(self::$tbl_notification_queue)) {
78 $fields = [
79 'notification_id' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
80 'usr_id' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
81 'valid_until' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
82 ];
83 $ilDB->createTable(self::$tbl_notification_queue, $fields);
84 $ilDB->addPrimaryKey(self::$tbl_notification_queue, ['notification_id', 'usr_id']);
85 }
86
87 if (!$ilDB->tableExists(self::$tbl_notification_osd_handler)) {
88 $fields = [
89 'notification_osd_id' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
90 'usr_id' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
91 'serialized' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 4000],
92 'valid_until' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
93 'time_added' => ['type' => ilDBConstants::T_INTEGER, 'notnull' => true, 'length' => 4],
94 'type' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
95 ];
96 $ilDB->createTable(self::$tbl_notification_osd_handler, $fields);
97
98 $ilDB->addPrimaryKey(self::$tbl_notification_osd_handler, ['notification_osd_id']);
99
100 $ilDB->createSequence(self::$tbl_notification_osd_handler);
101 }
102
103 if (!$ilDB->tableExists(self::$tbl_notification_channels)) {
104 $fields = [
105 'channel_name' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
106 'title' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
107 'description' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 4000],
108 'class' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
109 'include' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
110 'config_type' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 30],
111 ];
112 $ilDB->createTable(self::$tbl_notification_channels, $fields);
113
114 $ilDB->addPrimaryKey(self::$tbl_notification_channels, ['channel_name']);
115
117 $ilDB,
118 'mail',
119 'mail',
120 'mail_desc',
121 'ilNotificationMailHandler',
122 'components/ILIAS/Notifications/classes/class.ilNotificationMailHandler.php'
123 );
125 $ilDB,
126 'osd',
127 'osd',
128 'osd_desc',
129 'ilNotificationOSDHandler',
130 'components/ILIAS/Notifications/classes/class.ilNotificationOSDHandler.php'
131 );
132 }
133
134 if (!$ilDB->tableExists(self::$tbl_notification_types)) {
135 $fields = [
136 'type_name' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
137 'title' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
138 'description' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
139 'notification_group' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 100],
140 'config_type' => ['type' => ilDBConstants::T_TEXT, 'notnull' => true, 'length' => 30],
141 ];
142 $ilDB->createTable(self::$tbl_notification_types, $fields);
143 $ilDB->addPrimaryKey(self::$tbl_notification_types, ['type_name']);
144
145 self::registerType($ilDB, 'chat_invitation', 'chat_invitation', 'chat_invitation_description', 'chat');
146 self::registerType($ilDB, 'osd_maint', 'osd_maint', 'osd_maint_description', 'osd_notification');
147 }
148 }
static registerChannel(ilDBInterface $db, string $name, string $title, string $description, string $class, string $classfile, string $config_type='set_by_user')
static registerType(ilDBInterface $db, string $name, string $title, string $description, string $notification_group, string $config_type='set_by_user')
global $DIC
Definition: shib_login.php:26

References $DIC, $ilDB, ILIAS\Notifications\ilNotificationSetupHelper\registerChannel(), ILIAS\Notifications\ilNotificationSetupHelper\registerType(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

Field Documentation

◆ $tbl_notification_channels

string ILIAS\Notifications\ilNotificationSetupHelper::$tbl_notification_channels = 'notification_channels'
static

Definition at line 36 of file ilNotificationSetupHelper.php.

◆ $tbl_notification_data

string ILIAS\Notifications\ilNotificationSetupHelper::$tbl_notification_data = 'notification_data'
static

◆ $tbl_notification_osd_handler

◆ $tbl_notification_queue

string ILIAS\Notifications\ilNotificationSetupHelper::$tbl_notification_queue = 'notification_queue'
static

◆ $tbl_notification_types

string ILIAS\Notifications\ilNotificationSetupHelper::$tbl_notification_types = 'notification_types'
static

Definition at line 37 of file ilNotificationSetupHelper.php.

◆ $tbl_userconfig

string ILIAS\Notifications\ilNotificationSetupHelper::$tbl_userconfig = 'notification_usercfg'
static

◆ $tbl_userlistener


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