API / Minn\Admin / Notifications

Notifications final readonly class

Minn\Admin\Notifications · public/minn/src/Minn/Admin/Notifications.php · 191 lines

The bell feed: pending and recent comments, translation offers and a newer Minn, and new registrations. Plugin and theme update rows need an extension inventory the engine does not have (a recorded gap); on the reference database those sections are empty, so parity holds by construction.

Constants and properties

privatereadonly Minn\Db $db

Promoted from the constructor.

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

privatereadonly Minn\Content\Users $users

Promoted from the constructor.

privatereadonly Minn\Auth\Capabilities $capabilities

Promoted from the constructor.

privatereadonly Minn\Admin\ActivityFeed $feed

Promoted from the constructor.

privatereadonly Minn\Ops\Updates $updates

Promoted from the constructor.

privatereadonly Minn\Ops\Releases $releases

Promoted from the constructor.

Public

new__construct(Minn\Db $db, Minn\Content\Site $site, Minn\Content\Users $users, Minn\Auth\Capabilities $capabilities, Minn\Admin\ActivityFeed $feed, Minn\Ops\Updates $updates, Minn\Ops\Releases $releases)#
methoditems(int $userId): array#

The bell feed for a user, newest first, grouped and marked read or unread.

methodmarkRead(int $userId, string $id): void#

An id marks one item read; an empty id marks everything read.

Internals 7

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatecommentItems(int $userId): array#

Up to five pending comments for a moderator, then the three latest approved ones, each only when its post is visible to the caller.

@return list<array>
privateupdateItems(int $userId, int $now): array#

Plugin and theme offers for a caller who may apply them, stamped with the last check, then the translation total.

@return list<array>
privateupdateItem(string $id, string $title, int $time, array $update): array#
privatecoreItems(int $userId, int $now): array#

A newer Minn on offer (Ops\Releases). WordPress's own core offer and its auto-update notice are not shown: on Minn they could only speak of a parked copy, which is not what serves the site.

@return list<array>
privateregistrationItems(int $userId, int $now, int $offset): array#

The two newest registrations of the last week, for a caller who lists users.

@return list<array>
privatecommentItem(Minn\Content\CommentRecord|array $comment, string $template): array#
privatetranslationCount(): int#

Total translation offers across the three update transients.