ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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 135 of file ilNotificationSetupHelper.php.

References ILIAS\Notifications\ilNotificationDatabaseHandler\registerChannel().

135  : void
136  {
137  ilNotificationDatabaseHandler::registerChannel($db, $name, $title, $description, $class, $classfile, $config_type);
138  }
if($format !==null) $name
Definition: metadata.php:247
static registerChannel(ilDBInterface $db, string $name, string $title, string $description, string $class, string $classfile, string $config_type)
+ Here is the call 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 140 of file ilNotificationSetupHelper.php.

References ILIAS\Notifications\ilNotificationDatabaseHandler\registerType().

140  : void
141  {
142  ilNotificationDatabaseHandler::registerType($db, $name, $title, $description, $notification_group, $config_type);
143  }
static registerType(ilDBInterface $db, string $name, string $title, string $description, string $notification_group, string $config_type)
if($format !==null) $name
Definition: metadata.php:247
+ Here is the call graph for this function:

◆ setupTables()

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

Definition at line 38 of file ilNotificationSetupHelper.php.

References $DIC, and $ilDB.

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

Field Documentation

◆ $tbl_notification_channels

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

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

◆ $tbl_userconfig

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

◆ $tbl_userlistener


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