19 declare(strict_types=1);
    43         if ($clock === null) {
    44             $clock = (new \ILIAS\Data\Factory())->clock()->utc();
    51         $this->repo->createOSDNotification($notification->user->getId(), $notification);
    59         bool $append_osd_id_to_link = 
true,
    60         int $max_age_seconds = 0,
    63         $notifications = $this->repo->getOSDNotificationsByUser($user_id, $max_age_seconds, $type);
    65         foreach ($notifications as $notification) {
    66             if ($append_osd_id_to_link) {
    67                 foreach ($notification->getObject()->links as $link) {
    68                     $link->setUrl($this->
appendParamToLink($link->getUrl(), 
'osd_id', $notification->getId()));
    73         return $notifications;
    81         $this->repo->deleteStaleOSDNotificationsForUserAndType($type, $user_id, $this->clock->now()->getTimestamp());
    86         $this->repo->deleteStaleOSDNotificationsForUserAndType($provider, $user_id, $this->clock->now()->getTimestamp());
    91         return $this->repo->deleteOSDNotificationById($notification_osd_id);
    96         return $this->repo->deleteOSDNotificationByIdentification(
   105         if (str_contains($link, 
'?')) {
   106             $link .= 
'&' . $param . 
'=' . $value;
   108             $link .= 
'?' . $param . 
'=' . $value;
   116         $this->repo->deleteAllOSDNotifications();
 
deleteStaleNotificationsForUserAndType(int $user_id, string $type)
 
removeOSDNotification(int $notification_osd_id)
 
getOSDNotificationsForUser(int $user_id, bool $append_osd_id_to_link=true, int $max_age_seconds=0, string $type='')
 
notify(ilNotificationObject $notification)
 
__construct(?ilNotificationOSDRepository $repo=null, ?ClockInterface $clock=null)
 
readonly ClockInterface $clock
 
removeOSDNotificationByIdentification(string $provider, string $identification, int $user_id=0)
 
appendParamToLink(string $link, string $param, int $value)
 
readonly ilNotificationOSDRepository $repo
 
deleteStaleOSDNotificationsForUser(string $provider, int $user_id)