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
| private | readonly Minn\Db $db | Promoted from the constructor. |
| private | readonly Minn\Content\Site $site | Promoted from the constructor. |
| private | readonly Minn\Content\Users $users | Promoted from the constructor. |
| private | readonly Minn\Auth\Capabilities $capabilities | Promoted from the constructor. |
| private | readonly Minn\Admin\ActivityFeed $feed | Promoted from the constructor. |
| private | readonly Minn\Ops\Updates $updates | Promoted from the constructor. |
| private | readonly 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)# | |
| method | items(int $userId): array# | The bell feed for a user, newest first, grouped and marked read or unread. |
| method | markRead(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.
| private | commentItems(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> |
| private | updateItems(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> |
| private | updateItem(string $id, string $title, int $time, array $update): array# | |
| private | coreItems(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> |
| private | registrationItems(int $userId, int $now, int $offset): array# | The two newest registrations of the last week, for a caller who lists users. @return list<array> |
| private | commentItem(Minn\Content\CommentRecord|array $comment, string $template): array# | |
| private | translationCount(): int# | Total translation offers across the three update transients. |
Nothing matches.