OverviewController final readonly class
Minn\Admin\OverviewController · public/minn/src/Minn/Admin/OverviewController.php · 140 lines
The Overview of minn-admin/v1: the payload, the drill-down behind one chart bar, and the pick of cards, the person's own and the site's default.
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\Admin\Dashboard $dashboard | Promoted from the constructor. |
| private | readonly Minn\Content\Users $users | Promoted from the constructor. |
| private | readonly Minn\Rest\Caller $caller | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db, Minn\Content\Site $site, Minn\Admin\Dashboard $dashboard, Minn\Content\Users $users, Minn\Rest\Caller $caller)# | |
| method | overview(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/overview (floor edit_posts)# | The overview payload. |
| method | overviewActivity(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/overview/activity (floor edit_posts)# | The events behind one chart bar. |
| method | setOverviewMetrics(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/overview/metrics (floor edit_posts)# | Saves the caller's pick of overview cards. |
| method | setOverviewMetricDefaults(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/overview/metric-defaults (floor edit_posts + manage_options)# | Saves the site's default overview cards. |
Internals 5
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | metricKeysFrom(Minn\Http\Request $request): ?array# | The cleaned keys, null when the caller asked for a clear; a missing or non-list keys member refuses. |
| private | storedMetricLayout(int $userId): array# | The stored layout, unfiltered by the catalog, so a save answers without a second Overview round trip. |
| private | days(Minn\Http\Request $request): int# | ?days must be an in-range integer; the reference's parameter errors otherwise. |
| private | window(Minn\Http\Request $request): array# | Both bounds required, "Y-m-d H:i:s". @return array{0: string, 1: string} @return array{0: string, 1: string} |
| private | parameterError(string $param, string $code, string $message, mixed $data): Minn\RestError# |
Nothing matches.