PanelController
extends BaseController
in package
Panel controller - handles admin panel views and data aggregation
Tags
Table of Contents
Properties
- $flash : FlashMessengerInterface
- $renderer : ViewRendererInterface
- $requestContext : RequestContext
- $announcementPresenter : AnnouncementPresenter
- $getAllAnnouncementsUseCase : GetAllAnnouncementsUseCase
- $getAllCountdownsUseCase : GetAllCountdownsUseCase
- $getAllModulesUseCase : GetAllModulesUseCase
- $getAllUsersUseCase : GetAllUsersUseCase
- $logger : LoggerInterface
- $translator : Translator
Methods
- __construct() : mixed
- announcements() : ResponseInterface
- Display announcement management page Shows pending announcements separately from decided ones
- countdowns() : ResponseInterface
- Display countdowns management page
- index() : ResponseInterface
- Display the main admin panel page with overview
- modules() : ResponseInterface
- Display modules management page
- users() : ResponseInterface
- Display users management page
- flash() : void
- getCurrentUserId() : int|null
- jsonResponse() : ResponseInterface
- JSON response helper
- noContentResponse() : ResponseInterface
- No content response helper
- redirect() : ResponseInterface
- Redirect to URL
- render() : ResponseInterface
- Render view and return as response
- buildUsernamesMap() : array<string|int, mixed>
- Build map of user IDs to usernames for display purposes
- formatCountdowns() : array<string|int, mixed>
- Format countdown objects for display Ensures consistent date formatting
Properties
$flash read-only
public
FlashMessengerInterface
$flash
$renderer
public
ViewRendererInterface
$renderer
$requestContext
public
RequestContext
$requestContext
$announcementPresenter read-only
private
AnnouncementPresenter
$announcementPresenter
$getAllAnnouncementsUseCase read-only
private
GetAllAnnouncementsUseCase
$getAllAnnouncementsUseCase
$getAllCountdownsUseCase read-only
private
GetAllCountdownsUseCase
$getAllCountdownsUseCase
$getAllModulesUseCase read-only
private
GetAllModulesUseCase
$getAllModulesUseCase
$getAllUsersUseCase read-only
private
GetAllUsersUseCase
$getAllUsersUseCase
$logger read-only
private
LoggerInterface
$logger
$translator read-only
private
Translator
$translator
Methods
__construct()
public
__construct(RequestContext $requestContext, ViewRendererInterface $renderer, FlashMessengerInterface $flash, LoggerInterface $logger, GetAllModulesUseCase $getAllModulesUseCase, GetAllUsersUseCase $getAllUsersUseCase, GetAllCountdownsUseCase $getAllCountdownsUseCase, GetAllAnnouncementsUseCase $getAllAnnouncementsUseCase, Translator $translator, AnnouncementPresenter $announcementPresenter) : mixed
Parameters
- $requestContext : RequestContext
- $renderer : ViewRendererInterface
- $flash : FlashMessengerInterface
- $logger : LoggerInterface
- $getAllModulesUseCase : GetAllModulesUseCase
- $getAllUsersUseCase : GetAllUsersUseCase
- $getAllCountdownsUseCase : GetAllCountdownsUseCase
- $getAllAnnouncementsUseCase : GetAllAnnouncementsUseCase
- $translator : Translator
- $announcementPresenter : AnnouncementPresenter
announcements()
Display announcement management page Shows pending announcements separately from decided ones
public
announcements() : ResponseInterface
Tags
Return values
ResponseInterfacecountdowns()
Display countdowns management page
public
countdowns() : ResponseInterface
Tags
Return values
ResponseInterfaceindex()
Display the main admin panel page with overview
public
index() : ResponseInterface
Tags
Return values
ResponseInterfacemodules()
Display modules management page
public
modules() : ResponseInterface
Tags
Return values
ResponseInterfaceusers()
Display users management page
public
users() : ResponseInterface
Tags
Return values
ResponseInterfaceflash()
protected
flash(string $key, string $message) : void
Parameters
- $key : string
- $message : string
getCurrentUserId()
protected
getCurrentUserId() : int|null
Tags
Return values
int|nulljsonResponse()
JSON response helper
protected
jsonResponse(int $statusCode, array<string|int, mixed> $data) : ResponseInterface
Parameters
- $statusCode : int
- $data : array<string|int, mixed>
Return values
ResponseInterfacenoContentResponse()
No content response helper
protected
noContentResponse([int $statusCode = 204 ]) : ResponseInterface
Parameters
- $statusCode : int = 204
Return values
ResponseInterfaceredirect()
Redirect to URL
protected
redirect(string $location[, int $statusCode = 302 ]) : ResponseInterface
Parameters
- $location : string
- $statusCode : int = 302
Return values
ResponseInterfacerender()
Render view and return as response
protected
render(string $view[, array<string|int, mixed> $data = [] ][, int $statusCode = 200 ]) : ResponseInterface
Parameters
- $view : string
- $data : array<string|int, mixed> = []
- $statusCode : int = 200
Return values
ResponseInterfacebuildUsernamesMap()
Build map of user IDs to usernames for display purposes
private
buildUsernamesMap(array<string|int, mixed> $users) : array<string|int, mixed>
Parameters
- $users : array<string|int, mixed>
Return values
array<string|int, mixed>formatCountdowns()
Format countdown objects for display Ensures consistent date formatting
private
formatCountdowns(array<string|int, mixed> $countdowns) : array<string|int, mixed>
Parameters
- $countdowns : array<string|int, mixed>