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

Static Public Member Functions

static getTranslatedLanguageVariablesOfNotificationParameters (array $vars=[])
 
static setUserConfig (int $userid, array $configArray)
 
static loadUserConfig (int $userid)
 
static enqueueByUsers (ilNotificationConfig $notification, array $usr_ids)
 
static enqueueByListener (ilNotificationConfig $notification, int $ref_id)
 
static storeNotification (ilNotificationConfig $notification)
 
static removeNotification (int $id)
 
static getUsersByListener (string $module, int $sender_id)
 
static disableListeners (string $module, int $sender_id)
 
static enableListeners (string $module, int $sender_id, array $users=[])
 
static registerChannel (ilDBInterface $db, string $name, string $title, string $description, string $class, string $classfile, string $config_type)
 
static registerType (ilDBInterface $db, string $name, string $title, string $description, string $notification_group, string $config_type)
 
static getAvailableChannels (array $config_types=[], bool $include_disabled=false)
 
static getAvailableTypes (array $config_types=[])
 
static setConfigTypeForType (string $type_name, string $config_name)
 
static setConfigTypeForChannel (string $channel_name, string $config_name)
 
static getUsersWithCustomConfig (array $usr_ids)
 

Static Protected Member Functions

static fillPlaceholders (array $results, array $vars, array $lang_var_to_type_dict)
 
static findPlaceholders (string $pattern, string $translation)
 

Static Private Member Functions

static replaceFields (string $string, array $foundPlaceholders, array $params, string $startTag, string $endTage)
 

Detailed Description

Member Function Documentation

◆ disableListeners()

static ILIAS\Notifications\ilNotificationDatabaseHandler::disableListeners ( string  $module,
int  $sender_id 
)
static

Definition at line 346 of file ilNotificationDatabaseHandler.php.

346 : void
347 {
348 global $DIC;
349
350 $ilDB = $DIC->database();
351
352 $query = 'UPDATE ' . ilNotificationSetupHelper::$tbl_userlistener . ' SET disabled = 1 WHERE module = %s AND sender_id = %s';
354 $values = [$module, $sender_id];
355
356 $ilDB->manipulateF($query, $types, $values);
357 }
global $DIC
Definition: shib_login.php:26

References $DIC, $ilDB, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_userlistener, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by ILIAS\Notifications\ilNotificationSystem\toListeners().

+ Here is the caller graph for this function:

◆ enableListeners()

static ILIAS\Notifications\ilNotificationDatabaseHandler::enableListeners ( string  $module,
int  $sender_id,
array  $users = [] 
)
static
Parameters
list<int>$users

Definition at line 362 of file ilNotificationDatabaseHandler.php.

362 : void
363 {
364 global $DIC;
365
366 $ilDB = $DIC->database();
367
368 $query = 'UPDATE ' . ilNotificationSetupHelper::$tbl_userlistener . ' SET disabled = 0 WHERE module = %s AND sender_id = %s';
369
370 if ($users) {
371 $query .= ' ' . $ilDB->in('usr_id', $users, false, ilDBConstants::T_INTEGER);
372 }
373
375 $values = [$module, $sender_id];
376
377 $ilDB->manipulateF($query, $types, $values);
378 }

References $DIC, $ilDB, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_userlistener, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

◆ enqueueByListener()

static ILIAS\Notifications\ilNotificationDatabaseHandler::enqueueByListener ( ilNotificationConfig  $notification,
int  $ref_id 
)
static

Definition at line 260 of file ilNotificationDatabaseHandler.php.

260 : void
261 {
262 global $DIC;
263
264 $ilDB = $DIC->database();
265
266 $notification_id = self::storeNotification($notification);
267 $valid_until = $notification->getValidForSeconds() ? (time() + $notification->getValidForSeconds()) : 0;
268
269 $query = 'INSERT INTO ' . ilNotificationSetupHelper::$tbl_notification_queue . ' (notification_id, usr_id, valid_until, visible_for) '
270 . ' (SELECT %s, usr_id, %s, %s FROM ' . ilNotificationSetupHelper::$tbl_userlistener . ' WHERE disabled = 0 AND module = %s AND sender_id = %s)';
271
272 $types = [
278 ];
279
280 $values = [
281 $notification_id,
282 $valid_until,
283 $notification->getVisibleForSeconds(),
284 $notification->getType(),
285 $ref_id
286 ];
287
288 $ilDB->manipulateF($query, $types, $values);
289 }
static storeNotification(ilNotificationConfig $notification)
$ref_id
Definition: ltiauth.php:66

References $DIC, $ilDB, $ref_id, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_notification_queue, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_userlistener, ILIAS\Notifications\Model\ilNotificationConfig\getType(), ILIAS\Notifications\Model\ilNotificationConfig\getValidForSeconds(), ILIAS\Notifications\Model\ilNotificationConfig\getVisibleForSeconds(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by ILIAS\Notifications\ilNotificationSystem\toListeners().

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

◆ enqueueByUsers()

static ILIAS\Notifications\ilNotificationDatabaseHandler::enqueueByUsers ( ilNotificationConfig  $notification,
array  $usr_ids 
)
static
Parameters
list<int>$usr_ids

Definition at line 234 of file ilNotificationDatabaseHandler.php.

234 : void
235 {
236 if (!$usr_ids) {
237 return;
238 }
239
240 global $DIC;
241
242 $ilDB = $DIC->database();
243
244 $notification_id = self::storeNotification($notification);
245 $valid_until = $notification->getValidForSeconds() ? (time() + $notification->getValidForSeconds()) : 0;
246
247 foreach ($usr_ids as $userid) {
248 $ilDB->insert(
250 [
251 'notification_id' => [ilDBConstants::T_INTEGER, $notification_id],
252 'usr_id' => [ilDBConstants::T_INTEGER, $userid],
253 'valid_until' => [ilDBConstants::T_INTEGER, $valid_until],
254 'visible_for' => [ilDBConstants::T_INTEGER, $notification->getVisibleForSeconds()]
255 ]
256 );
257 }
258 }

References $DIC, $ilDB, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_notification_queue, ILIAS\Notifications\Model\ilNotificationConfig\getValidForSeconds(), ILIAS\Notifications\Model\ilNotificationConfig\getVisibleForSeconds(), and ilDBConstants\T_INTEGER.

Referenced by ILIAS\Notifications\ilNotificationSystem\toUsers().

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

◆ fillPlaceholders()

static ILIAS\Notifications\ilNotificationDatabaseHandler::fillPlaceholders ( array  $results,
array  $vars,
array  $lang_var_to_type_dict 
)
staticprotected
Parameters
array<string,object{lang_untouchedarray<string, string>, params: list<string>}> $results
array<string,ilNotificationParameter>$vars
array<string,string>$lang_var_to_type_dict
Returns
array<string, object{lang_untouched: array<string, string>, lang: array<string, string>, params: list<string>}>

Definition at line 84 of file ilNotificationDatabaseHandler.php.

84 : array
85 {
86 $pattern_old = '/##(.+?)##/im';
87 $pattern = '/\[(.+?)\]/im';
88
89 foreach ($results as $lang_var => $res) {
90 $placeholders_stack = [];
91 $res->lang = [];
92
93 foreach ($res->lang_untouched as $iso2_short_handle => $translation) {
94 $translation = str_replace("\\n", "\n", (string) $translation);
95 $placeholders_stack[] = self::findPlaceholders($pattern, $translation);
96 $translation = self::replaceFields(
97 $translation,
98 $placeholders_stack[count($placeholders_stack) - 1],
99 $vars[$lang_var_to_type_dict[$lang_var]]->getParameters(),
100 '[',
101 ']'
102 );
103 $placeholders_stack[] = self::findPlaceholders($pattern_old, $translation);
104 $res->lang[$iso2_short_handle] = self::replaceFields(
105 $translation,
106 $placeholders_stack[count($placeholders_stack) - 1],
107 $vars[$lang_var_to_type_dict[$lang_var]]->getParameters(),
108 '##',
109 '##'
110 );
111 }
112
113 $res->params = array_diff(
114 array_unique(
115 array_merge(...$placeholders_stack)
116 ),
117 array_keys($vars[$lang_var_to_type_dict[$lang_var]]->getParameters())
118 );
119 }
120
121 return $results;
122 }
static findPlaceholders(string $pattern, string $translation)
static replaceFields(string $string, array $foundPlaceholders, array $params, string $startTag, string $endTage)
$res
Definition: ltiservices.php:69
$results

References $res, $results, ILIAS\Notifications\ilNotificationDatabaseHandler\findPlaceholders(), and ILIAS\Notifications\ilNotificationDatabaseHandler\replaceFields().

Referenced by ILIAS\Notifications\ilNotificationDatabaseHandler\getTranslatedLanguageVariablesOfNotificationParameters().

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

◆ findPlaceholders()

static ILIAS\Notifications\ilNotificationDatabaseHandler::findPlaceholders ( string  $pattern,
string  $translation 
)
staticprotected
Returns
list<string>

Definition at line 127 of file ilNotificationDatabaseHandler.php.

127 : array
128 {
129 $foundPlaceholders = [];
130 preg_match_all($pattern, $translation, $foundPlaceholders);
131
132 return (array) $foundPlaceholders[1];
133 }

Referenced by ILIAS\Notifications\ilNotificationDatabaseHandler\fillPlaceholders().

+ Here is the caller graph for this function:

◆ getAvailableChannels()

static ILIAS\Notifications\ilNotificationDatabaseHandler::getAvailableChannels ( array  $config_types = [],
bool  $include_disabled = false 
)
static
Parameters
list<string>$config_types
Returns
array<string, array<string, mixed>>

Definition at line 426 of file ilNotificationDatabaseHandler.php.

426 : array
427 {
428 global $DIC;
429
430 $ilDB = $DIC->database();
431
432 $query = 'SELECT channel_name, title, description, class, include, config_type FROM ' . ilNotificationSetupHelper::$tbl_notification_channels;
433 if ($config_types) {
434 $query .= ' WHERE ' . $ilDB->in('config_type', $config_types, false, ilDBConstants::T_TEXT);
435 }
436
437 $rset = $ilDB->query($query);
438
439 $result = [];
440
441 $settings = new ilSetting('notifications');
442
443 while ($row = $ilDB->fetchAssoc($rset)) {
444 if (!$include_disabled && !$settings->get('enable_' . $row['channel_name'])) {
445 continue;
446 }
447
448 $result[$row['channel_name']] = [
449 'name' => $row['channel_name'],
450 'title' => $row['title'],
451 'description' => $row['description'],
452 'handler' => $row['class'],
453 'include' => $row['include'],
454 'config_type' => $row['config_type'],
455 ];
456 }
457
458 return $result;
459 }
ILIAS Setting Class.

References $DIC, $ilDB, and ilDBConstants\T_TEXT.

Referenced by ILIAS\Notifications\ilNotificationSystem\toUsers().

+ Here is the caller graph for this function:

◆ getAvailableTypes()

static ILIAS\Notifications\ilNotificationDatabaseHandler::getAvailableTypes ( array  $config_types = [])
static
Parameters
list<string>$config_types
Returns
array<string, array<string, mixed>>

Definition at line 465 of file ilNotificationDatabaseHandler.php.

465 : array
466 {
467 global $DIC;
468
469 $ilDB = $DIC->database();
470
471 $query = 'SELECT type_name, title, description, notification_group, config_type FROM ' . ilNotificationSetupHelper::$tbl_notification_types;
472 if ($config_types) {
473 $query .= ' WHERE ' . $ilDB->in('config_type', $config_types, false, ilDBConstants::T_TEXT);
474 }
475
476 $rset = $ilDB->query($query);
477
478 $result = [];
479
480 while ($row = $ilDB->fetchAssoc($rset)) {
481 $result[$row['type_name']] = [
482 'name' => $row['type_name'],
483 'title' => $row['title'],
484 'description' => $row['description'],
485 'group' => $row['notification_group'],
486 'config_type' => $row['config_type'],
487 ];
488 }
489
490 return $result;
491 }

References $DIC, $ilDB, and ilDBConstants\T_TEXT.

Referenced by ILIAS\Notifications\ilNotificationSystem\toUsers().

+ Here is the caller graph for this function:

◆ getTranslatedLanguageVariablesOfNotificationParameters()

static ILIAS\Notifications\ilNotificationDatabaseHandler::getTranslatedLanguageVariablesOfNotificationParameters ( array  $vars = [])
static
Parameters
array<string,ilNotificationParameter>$vars
Returns
array<string, object{lang_untouched: array<string, string>, lang: array<string, string>, params: list<string>}>

Definition at line 39 of file ilNotificationDatabaseHandler.php.

39 : array
40 {
41 global $DIC;
42
43 $ilDB = $DIC->database();
44
45 $where = [];
46 $lang_var_to_type_dict = [];
47
48 foreach ($vars as $type => $var) {
49 $where[] = sprintf(
50 'module = %s AND identifier = %s',
51 $ilDB->quote($var->getLanguageModule()),
52 $ilDB->quote($var->getName())
53 );
54
55 $lang_var_to_type_dict[$var->getName()] = $type;
56 }
57
58 if (!$where) {
59 return [];
60 }
61
62 $query = 'SELECT identifier, lang_key, value FROM lng_data WHERE (' . implode(') OR (', $where) . ')';
63 $res = $ilDB->query($query);
64 $results = [];
65
66 while ($row = $ilDB->fetchAssoc($res)) {
67 if (!isset($results[$row['identifier']])) {
68 $results[$row['identifier']] = new stdClass();
69 $results[$row['identifier']]->lang_untouched = [];
70 $results[$row['identifier']]->params = [];
71 }
72 $results[$row['identifier']]->lang_untouched[$row['lang_key']] = $row['value'];
73 }
74
75 return self::fillPlaceholders($results, $vars, $lang_var_to_type_dict);
76 }
static fillPlaceholders(array $results, array $vars, array $lang_var_to_type_dict)

References $DIC, $ilDB, $res, $results, and ILIAS\Notifications\ilNotificationDatabaseHandler\fillPlaceholders().

Referenced by ILIAS\Notifications\ilNotificationSystem\toUsers().

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

◆ getUsersByListener()

static ILIAS\Notifications\ilNotificationDatabaseHandler::getUsersByListener ( string  $module,
int  $sender_id 
)
static
Returns
list<int>

Definition at line 326 of file ilNotificationDatabaseHandler.php.

326 : array
327 {
328 global $DIC;
329
330 $ilDB = $DIC->database();
331
332 $query = 'SELECT usr_id FROM ' . ilNotificationSetupHelper::$tbl_userlistener . ' WHERE disabled = 0 AND module = %s AND sender_id = %s';
334 $values = [$module, $sender_id];
335
336 $users = [];
337
338 $rset = $ilDB->queryF($query, $types, $values);
339 while ($row = $ilDB->fetchAssoc($rset)) {
340 $users[] = (int) $row['usr_id'];
341 }
342
343 return $users;
344 }

References $DIC, $ilDB, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_userlistener, ILIAS\Repository\int(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by ILIAS\Notifications\ilNotificationSystem\toListeners().

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

◆ getUsersWithCustomConfig()

static ILIAS\Notifications\ilNotificationDatabaseHandler::getUsersWithCustomConfig ( array  $usr_ids)
static
Parameters
list<int>$usr_ids
Returns
array<int, bool>

Definition at line 521 of file ilNotificationDatabaseHandler.php.

521 : array
522 {
523 global $DIC;
524
525 $ilDB = $DIC->database();
526
527 $query = 'SELECT usr_id, value FROM usr_pref WHERE ' . $ilDB->in(
528 'usr_id',
529 $usr_ids,
530 false,
532 ) . ' AND keyword = ' . $ilDB->quote(
533 'use_custom_notification_setting',
535 ) . ' AND value = ' . $ilDB->quote(
536 '1',
538 );
539 $rset = $ilDB->query($query);
540 $result = [];
541 while ($row = $ilDB->fetchAssoc($rset)) {
542 $result[(int) $row['usr_id']] = (bool) $row['value'];
543 }
544
545 $missing_usr_ids = array_diff(
546 $usr_ids,
547 array_keys($result)
548 );
549
550 $result = $result + array_combine(
551 $missing_usr_ids,
552 array_fill(0, count($missing_usr_ids), false)
553 );
554
555 return $result;
556 }

References $DIC, $ilDB, ILIAS\Repository\int(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by ILIAS\Notifications\ilNotificationSystem\toUsers().

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

◆ loadUserConfig()

static ILIAS\Notifications\ilNotificationDatabaseHandler::loadUserConfig ( int  $userid)
static
Returns
array<string, list<string>>

Definition at line 206 of file ilNotificationDatabaseHandler.php.

206 : array
207 {
208 global $DIC;
209
210 $ilDB = $DIC->database();
211
212 $query = 'SELECT module, channel FROM ' . ilNotificationSetupHelper::$tbl_userconfig . ' WHERE usr_id = %s';
213 $types = [ilDBConstants::T_INTEGER];
214 $values = [$userid];
215
216 $res = $ilDB->queryF($query, $types, $values);
217
218 $result = [];
219
220 while ($row = $ilDB->fetchAssoc($res)) {
221 if (!isset($result[$row['module']])) {
222 $result[$row['module']] = [];
223 }
224
225 $result[$row['module']][] = $row['channel'];
226 }
227
228 return $result;
229 }

References $DIC, $ilDB, $res, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_userconfig, and ilDBConstants\T_INTEGER.

Referenced by ILIAS\Notifications\ilNotificationSystem\toUsers().

+ Here is the caller graph for this function:

◆ registerChannel()

static ILIAS\Notifications\ilNotificationDatabaseHandler::registerChannel ( ilDBInterface  $db,
string  $name,
string  $title,
string  $description,
string  $class,
string  $classfile,
string  $config_type 
)
static

Definition at line 380 of file ilNotificationDatabaseHandler.php.

388 : void {
389 $db->insert(
391 [
392 'channel_name' => [ilDBConstants::T_TEXT, $name],
393 'title' => [ilDBConstants::T_TEXT, $title],
394 'description' => [ilDBConstants::T_TEXT, $description],
395 'class' => [ilDBConstants::T_TEXT, $class],
396 'include' => [ilDBConstants::T_TEXT, $classfile],
397 'config_type' => [ilDBConstants::T_TEXT, $config_type],
398 ]
399 );
400 }

◆ registerType()

static ILIAS\Notifications\ilNotificationDatabaseHandler::registerType ( ilDBInterface  $db,
string  $name,
string  $title,
string  $description,
string  $notification_group,
string  $config_type 
)
static

Definition at line 402 of file ilNotificationDatabaseHandler.php.

409 : void {
410 $db->insert(
412 [
413 'type_name' => [ilDBConstants::T_TEXT, $name],
414 'title' => [ilDBConstants::T_TEXT, $title],
415 'description' => [ilDBConstants::T_TEXT, $description],
416 'notification_group' => [ilDBConstants::T_TEXT, $notification_group],
417 'config_type' => [ilDBConstants::T_TEXT, $config_type],
418 ]
419 );
420 }

◆ removeNotification()

static ILIAS\Notifications\ilNotificationDatabaseHandler::removeNotification ( int  $id)
static

Definition at line 310 of file ilNotificationDatabaseHandler.php.

310 : void
311 {
312 global $DIC;
313
314 $ilDB = $DIC->database();
315
316 $query = 'DELETE FROM ' . ilNotificationSetupHelper::$tbl_notification_data . ' WHERE notification_id = %s';
317 $types = [ilDBConstants::T_INTEGER];
318 $values = [$id];
319
320 $ilDB->manipulateF($query, $types, $values);
321 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $DIC, $id, $ilDB, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_notification_data, and ilDBConstants\T_INTEGER.

◆ replaceFields()

static ILIAS\Notifications\ilNotificationDatabaseHandler::replaceFields ( string  $string,
array  $foundPlaceholders,
array  $params,
string  $startTag,
string  $endTage 
)
staticprivate
Parameters
list<string>$foundPlaceholders
array<string,mixed>$params

Definition at line 139 of file ilNotificationDatabaseHandler.php.

145 : string {
146 $result = $string;
147 foreach ($foundPlaceholders as $placeholder) {
148 if (array_key_exists(strtoupper($placeholder), $params)) {
149 $result = str_ireplace($startTag . $placeholder . $endTage, $params[strtoupper($placeholder)], $result);
150 }
151 if (array_key_exists(strtolower($placeholder), $params)) {
152 $result = str_ireplace($startTag . $placeholder . $endTage, $params[strtolower($placeholder)], $result);
153 }
154 }
155 return $result;
156 }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31

References $params.

Referenced by ILIAS\Notifications\ilNotificationDatabaseHandler\fillPlaceholders().

+ Here is the caller graph for this function:

◆ setConfigTypeForChannel()

static ILIAS\Notifications\ilNotificationDatabaseHandler::setConfigTypeForChannel ( string  $channel_name,
string  $config_name 
)
static

Definition at line 505 of file ilNotificationDatabaseHandler.php.

505 : void
506 {
507 global $DIC;
508
509 $ilDB = $DIC->database();
510
511 $query = 'UPDATE ' . ilNotificationSetupHelper::$tbl_notification_channels . ' SET config_type = %s WHERE channel_name = %s';
513 $values = [$config_name, $channel_name];
514 $ilDB->manipulateF($query, $types, $values);
515 }

References $DIC, $ilDB, and ilDBConstants\T_TEXT.

◆ setConfigTypeForType()

static ILIAS\Notifications\ilNotificationDatabaseHandler::setConfigTypeForType ( string  $type_name,
string  $config_name 
)
static

Definition at line 493 of file ilNotificationDatabaseHandler.php.

493 : void
494 {
495 global $DIC;
496
497 $ilDB = $DIC->database();
498
499 $query = 'UPDATE ' . ilNotificationSetupHelper::$tbl_notification_types . ' SET config_type = %s WHERE type_name = %s';
501 $values = [$config_name, $type_name];
502 $ilDB->manipulateF($query, $types, $values);
503 }

References $DIC, $ilDB, and ilDBConstants\T_TEXT.

◆ setUserConfig()

static ILIAS\Notifications\ilNotificationDatabaseHandler::setUserConfig ( int  $userid,
array  $configArray 
)
static
Parameters
array<string,array<string,string>>$configArray

Definition at line 161 of file ilNotificationDatabaseHandler.php.

161 : void
162 {
163 global $DIC;
164
165 $ilDB = $DIC->database();
166
167 if ($userid !== -1) {
168 $channels = self::getAvailableChannels(['set_by_user']);
169 $types = self::getAvailableTypes(['set_by_user']);
170 $query = 'DELETE FROM ' . ilNotificationSetupHelper::$tbl_userconfig . ' WHERE usr_id = %s AND ' . $ilDB->in(
171 'module',
172 array_keys($types),
173 false,
175 ) . ' AND ' . $ilDB->in('channel', array_keys($channels), false, ilDBConstants::T_TEXT);
176 } else {
177 $query = 'DELETE FROM ' . ilNotificationSetupHelper::$tbl_userconfig . ' WHERE usr_id = %s';
178 }
179
180 $types = [ilDBConstants::T_INTEGER];
181 $values = [$userid];
182
183 // delete old settings
184 $ilDB->manipulateF($query, $types, $values);
185
186 foreach ($configArray as $type => $channels) {
187 foreach ($channels as $channel => $value) {
188 if (!$value) {
189 continue;
190 }
191 $ilDB->insert(
193 [
194 'usr_id' => [ilDBConstants::T_INTEGER, $userid],
195 'module' => [ilDBConstants::T_TEXT, $type],
196 'channel' => [ilDBConstants::T_TEXT, $channel],
197 ]
198 );
199 }
200 }
201 }
static getAvailableChannels(array $config_types=[], bool $include_disabled=false)

References $DIC, $ilDB, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_userconfig, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

◆ storeNotification()

static ILIAS\Notifications\ilNotificationDatabaseHandler::storeNotification ( ilNotificationConfig  $notification)
static

Definition at line 291 of file ilNotificationDatabaseHandler.php.

291 : int
292 {
293 global $DIC;
294
295 $ilDB = $DIC->database();
296
298
299 $ilDB->insert(
301 [
302 'notification_id' => [ilDBConstants::T_INTEGER, $id],
303 'serialized' => [ilDBConstants::T_TEXT, serialize($notification)],
304 ]
305 );
306
307 return $id;
308 }

References $DIC, $id, $ilDB, ILIAS\Notifications\ilNotificationSetupHelper\$tbl_notification_data, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.


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