Documentations › mmo.client › php › classes JsonNotificationStore MMO\client\classes · 1 symbol · generated 27 Oct 2026
The notifications kept in a folder, one JSON file per recipient ({md5 of the uid}.json, the uid inside), the latest last, at most $max : the oldest read ones go first. Written under a lock and through a temporary file.
class MMO\client\classes\JsonNotificationStore
implements MMO\client\interfaces\iNotificationStore Namespace MMO\client\classesImplements iNotificationStore $store = new JsonNotificationStore('/var/www/app/db/notifications'); $store->add('main/users/42', ['kind' => 'dev.ticket', 'title' => 'New ticket #175', 'url' => 'developer/boards']);
Properties2 readonly string $folder Type string readonly int $max Type int Methods8 function add(string $recipient, array $notification): array protected function edit(string $recipient, callable $change): void function file(string $recipient): string function list(string $recipient, int $limit = 50): array function markRead(string $recipient, ?string $id = null, bool $read = true): int protected function read(string $recipient): array $recipient string returns array the recipient's notifications, the oldest first
function unread(string $recipient): int function __construct(string $folder, int $max = 200) $folder string made when missing $max = 200 int how many a recipient keeps