API / Minn\Admin / ActivityFeed

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

privatereadonly Minn\Db $db

Promoted from the constructor.

privatereadonly Minn\Content\Users $users

Promoted from the constructor.

privatereadonly Minn\Auth\Capabilities $capabilities

Promoted from the constructor.

Public

new__construct(Minn\Db $db, Minn\Content\Users $users, Minn\Auth\Capabilities $capabilities)#
methodrecent(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>
methodbetween(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>
methodcommentVisible(int $userId, int $postId): bool#

May this caller see a comment row that names its post?

methodpostTitle(int $postId): string#

A post's stored title, empty when the post is gone.

methoddisplayName(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.

privateownPosts(int $userId, int $offset): array#

The caller's own posts, merged from a by-modified and a by-date window.

@return list<array>
privatelatestComments(int $userId): array#
@return list<array>
privatepublishedBetween(string $from, string $to): array#
@return list<array>
privatecommentsBetween(int $userId, string $from, string $to): array#
@return list<array>