ActivityChart final readonly class
Minn\Admin\ActivityChart · public/minn/src/Minn/Admin/ActivityChart.php · 65 lines
The overview's activity chart: published posts and pages plus every comment, counted per bar. A window over 45 days is drawn in weeks, anything shorter in days; each bar carries the (from, to] GMT bounds the drill-down asks for.
Uses 2
Used by 2
Constants and properties
| private | readonly Minn\Db $db | Promoted from the constructor. |
| private | readonly Minn\Content\Site $site | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db, Minn\Content\Site $site)# | ||||
| method | bars(int $days, int $now): array# | The bars for a window of days, counted from the database. @return list<array{label: string, value: int, from: string, to: string}> | |||
| static | bucket(array $dates, int $days, int $now, int $offset): array# | GMT stamps into bars, oldest first. Labels are site-local: the day for daily bars, "Week of" the bar's first day for weekly ones.
@return list<array{label: string, value: int, from: string, to: string}> |
Nothing matches.