MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

iNotificationStore

MMO\client\interfaces · 1 symbol · generated 27 Oct 2026

interface

iNotificationStore

iNotificationStore.php:12

Where the notification centre (Notifications) keeps each recipient's notifications. A JSON file per recipient for now (JsonNotificationStore); a database of its own later, implementing this.

interface MMO\client\interfaces\iNotificationStore
Namespace
MMO\client\interfaces
A notification is `{id, kind, title, body, url, icon, from, createdAt, readAt}`: `kind` what it is about (`dev.ticket`), `url` where it leads, `readAt` null until it is read.

Methods4

add($recipient, $notification)

abstractiNotificationStore.php:18
abstract function add(string $recipient, array $notification): array
$recipientstringwho it is for (a user's uid)
$notificationarraywithout id nor createdAt, which the store gives
returnsarraythe notification as kept

list($recipient, $limit)

abstractiNotificationStore.php:25
abstract function list(string $recipient, int $limit = 50): array
$recipientstring
$limit = 50intthe latest first, at most this many
returnsarray

markRead($recipient, $id, $read)

abstractiNotificationStore.php:36
abstract function markRead(string $recipient, ?string $id = null, bool $read = true): int
$recipientstring
$id = nullnull | stringone notification, null for every one
$read = trueboolfalse marks it unread again
returnsinthow many changed