19 declare(strict_types=1);
    46         if ($database === null) {
    48             $database = $DIC->database();
    61         $base = $object->baseNotification;
    69             $base->getValidForSeconds() ? $base->getValidForSeconds() + $now : 0,
    70             $base->getVisibleForSeconds(),
    72             $base->getIdentification()
    75         if (in_array($notification->getType(), self::UNIQUE_TYPES)) {
    79         $affected = $this->database->insert(
    93         return ($affected === 1) ? $notification : null;
   100         $row = $this->database->fetchAssoc($result);
   102         return ((
int) ($row[
'count'] ?? 0)) === 1;
   109         if ($max_age_seconds === 0) {
   110             $max_age_seconds = $now;
   115             ' WHERE usr_id = %s AND (valid_until = 0 OR valid_until > %s) AND time_added > %s';
   118         $values = [
$user_id, $now, $now - $max_age_seconds];
   121             $query .= 
' AND type = %s';
   126         $rset = $this->database->queryF($query, $types, $values);
   129         while ($row = $this->database->fetchAssoc($rset)) {
   130             $object = unserialize(
   132                 [
'allowed_classes' => [ilNotificationObject::class, ilNotificationLink::class, ilNotificationParameter::class]]
   134             if (isset($object->handlerParams[
''], $object->handlerParams[
'osd'])) {
   135                 $object->handlerParams = [
   136                     'general' => $object->handlerParams[
''],
   137                     'osd' => $object->handlerParams[
'osd']
   141                 (
int) $row[
'notification_osd_id'],
   142                 (
int) $row[
'usr_id'],
   144                 (
int) $row[
'time_added'],
   145                 (
int) $row[
'valid_until'],
   146                 (
int) $row[
'visible_for'],
   151             $notifications[] = $notification;
   154         return $notifications;
   170         $this->database->manipulateF(
   181         $values = [$povider_type, $identification];
   183             $query .= 
' AND user_id = %s';
   187         return (1 === $this->database->manipulateF($query, $keys, $values));
   193         $this->database->manipulateF(
   196             [$povider_type, $user_id, $until_timestamp]
 
deleteOSDNotificationById(int $id)
 
deleteOSDNotificationByUserAndType(int $user_id, string $type)
 
__construct(?ilDBInterface $database=null)
 
deleteStaleOSDNotificationsForUserAndType(string $povider_type, int $user_id, int $until_timestamp)
 
getOSDNotificationsByUser(int $user_id, int $max_age_seconds=0, string $type='')
 
ifOSDNotificationExistsById(int $id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
deleteOSDNotificationByIdentification(string $povider_type, string $identification, int $user_id=0)
 
getCurrentUnixTimestamp()
 
readonly ilDBInterface $database
 
deleteAllOSDNotifications()
 
static string $tbl_notification_osd_handler
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
createOSDNotification(int $user_id, ilNotificationObject $object)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...