ActivityFeed final readonly class
Minn\Admin\ActivityFeed · public/minn/src/Minn/Admin/ActivityFeed.php · 212 lines
What happened lately, as the overview and the bell tell it: the caller's own recent posts and the latest comments, and the events behind one chart bar. Also the visibility rule every comment row is put through.
Constants and properties
| private | readonly Minn\Db $db | Promoted from the constructor. |
| private | readonly Minn\Content\Users $users | Promoted from the constructor. |
| private | readonly Minn\Auth\Capabilities $capabilities | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db, Minn\Content\Users $users, Minn\Auth\Capabilities $capabilities)# | |
| method | recent(int $userId, int $now, int $offset): array# | The overview's four most recent items, times already worded ("2 hours ago"). Oracle-caught quirk: the reference's recent-activity query runs with a multi-type post_type plus perm=editable, and on that combination it restricts EVERY status to post_author = caller, admins included, published posts included. Authorless posts appear for nobody. The engine reproduces the observed behavior, not the intent. @return list<array> |
| method | between(int $userId, string $from, string $to, int $now): array# | The events behind one chart bar, (from, to] GMT, newest first. Post rows decode the RAW stored title; comment rows decode the texturized one (the reference's asymmetry, kept). @return list<array> |
| method | commentVisible(int $userId, int $postId): bool# | May this caller see a comment row that names its post? |
| method | postTitle(int $postId): string# | A post's stored title, empty when the post is gone. |
| method | displayName(int $userId): string# | A user's display name, empty when the user is gone. |
Internals 4
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | ownPosts(int $userId, int $offset): array# | The caller's own posts, merged from a by-modified and a by-date window. @return list<array> |
| private | latestComments(int $userId): array# | @return list<array> |
| private | publishedBetween(string $from, string $to): array# | @return list<array> |
| private | commentsBetween(int $userId, string $from, string $to): array# | @return list<array> |
Nothing matches.