Support
Reference for the Support module: every class and function, with its full signature, parameters and return type. Create support tickets from members or anonymous visitors, render chat and ticket-creation UI, and map ticket, message and resolution rows to immutable data objects.
This page is a pure reference. It documents only what the module's source defines: the ticket data objects, the database helpers that insert and map ticket rows, and the two UI component classes.
SupportChatUi- support chat UI components.SupportDatabase- insert support tickets and map ticket rows to data objects.SupportTicketData- immutable data for a single support ticket.SupportTicketMessageData- immutable data for a single message on a support ticket.SupportTicketResolutionData- immutable data for the resolution of a support ticket.SupportTicketUi- support ticket UI components.
SupportChatUi
Support chat UI components.
Message
SupportChatUi::Message(string $name, string $message, CalendarDateTimeData $time, string $align = 'left'): void
Render a single chat message bubble.
| Name | Type | Description |
|---|---|---|
$name | string | Name of the sender. |
$message | string | Message text. |
$time | CalendarDateTimeData | Time when the message was sent. |
$align | string | Alignment: 'left' or 'right'. |
Returns void
SupportDatabase
Static functions that insert support tickets and map ticket, message and resolution rows to their data objects.
fromMessageRow
SupportDatabase::fromMessageRow(stdClass $row): SupportTicketMessageData
Map a support_ticket_message row to data.
| Name | Type | Description |
|---|---|---|
$row | stdClass | A support_ticket_message row. |
Returns SupportTicketMessageData The mapped message data.
fromResolutionRow
SupportDatabase::fromResolutionRow(stdClass $row): SupportTicketResolutionData
Map a support_ticket_resolution row to data.
| Name | Type | Description |
|---|---|---|
$row | stdClass | A support_ticket_resolution row. |
Returns SupportTicketResolutionData The mapped resolution data.
fromRow
SupportDatabase::fromRow(stdClass $row): SupportTicketData
Map a support_ticket row to data.
| Name | Type | Description |
|---|---|---|
$row | stdClass | A support_ticket row. |
Returns SupportTicketData The mapped ticket data.
InsertAnonymousTicket
SupportDatabase::InsertAnonymousTicket(string $email, string $phone, string $text): int
Insert a support ticket with only an email, phone and message, timestamped with the current time.
| Name | Type | Description |
|---|---|---|
$email | string | Email address. |
$phone | string | Phone number. |
$text | string | Ticket text. |
Returns int The new ticket id.
InsertTicket
SupportDatabase::InsertTicket(int|null $memberId, string $email, string $phone, string $text, string|null $tableName = null, int|null $tableId = null): int
Insert a new support ticket with optional member ID and table reference.
| Name | Type | Description |
|---|---|---|
$memberId | int|null | Member ID (null for anonymous tickets). |
$email | string | Email address. |
$phone | string | Phone number. |
$text | string | Ticket text. |
$tableName | string|null | Optional table name this ticket is linked to. |
$tableId | int|null | Optional table ID this ticket is linked to. |
Returns int The new ticket id.
SupportTicketData
Immutable data for a single support ticket. Fields and constructor only.
Properties
| Property | Type | Description |
|---|---|---|
$data->id | int | The ticket id (readonly). |
$data->memberId | int|null | The member id, or null for anonymous tickets (readonly). |
$data->email | string | Email address (readonly). |
$data->phone | string | Phone number (readonly). |
$data->text | string | Ticket text (readonly). |
$data->tableName | string|null | Optional table name this ticket is linked to (readonly). |
$data->tableId | int|null | Optional table id this ticket is linked to (readonly). |
$data->added | CalendarDateTimeData | When the ticket was added (readonly). |
__construct
new SupportTicketData(int $id = 0, int|null $memberId = null, string $email = '', string $phone = '', string $text = '', string|null $tableName = null, int|null $tableId = null, CalendarDateTimeData $added = new CalendarDateTimeData())
Create support ticket data.
| Name | Type | Description |
|---|---|---|
$id | int | The ticket id. |
$memberId | int|null | The member id, or null for anonymous tickets. |
$email | string | Email address. |
$phone | string | Phone number. |
$text | string | Ticket text. |
$tableName | string|null | Optional table name this ticket is linked to. |
$tableId | int|null | Optional table id this ticket is linked to. |
$added | CalendarDateTimeData | When the ticket was added. |
Returns SupportTicketData
SupportTicketMessageData
Immutable data for a single message on a support ticket. Fields and constructor only.
Properties
| Property | Type | Description |
|---|---|---|
$data->id | int | The message id (readonly). |
$data->ticketId | int | The ticket this message belongs to (readonly). |
$data->text | string | Message text (readonly). |
$data->adminUserId | int|null | The admin user id that sent the message, or null (readonly). |
$data->added | CalendarDateTimeData | When the message was added (readonly). |
__construct
new SupportTicketMessageData(int $id = 0, int $ticketId = 0, string $text = '', int|null $adminUserId = null, CalendarDateTimeData $added = new CalendarDateTimeData())
Create support ticket message data.
| Name | Type | Description |
|---|---|---|
$id | int | The message id. |
$ticketId | int | The ticket this message belongs to. |
$text | string | Message text. |
$adminUserId | int|null | The admin user id that sent the message, or null. |
$added | CalendarDateTimeData | When the message was added. |
Returns SupportTicketMessageData
SupportTicketResolutionData
Immutable data for the resolution of a support ticket. Fields and constructor only.
Properties
| Property | Type | Description |
|---|---|---|
$data->id | int | The resolution id (readonly). |
$data->ticketId | int | The ticket this resolution belongs to (readonly). |
$data->success | bool | Whether the ticket was resolved successfully (readonly). |
$data->adminNotes | string|null | Optional admin notes on the resolution (readonly). |
$data->added | CalendarDateTimeData | When the resolution was added (readonly). |
__construct
new SupportTicketResolutionData(int $id = 0, int $ticketId = 0, bool $success = false, string|null $adminNotes = null, CalendarDateTimeData $added = new CalendarDateTimeData())
Create support ticket resolution data.
| Name | Type | Description |
|---|---|---|
$id | int | The resolution id. |
$ticketId | int | The ticket this resolution belongs to. |
$success | bool | Whether the ticket was resolved successfully. |
$adminNotes | string|null | Optional admin notes on the resolution. |
$added | CalendarDateTimeData | When the resolution was added. |
Returns SupportTicketResolutionData
SupportTicketUi
Support ticket UI components.
CreatePanel
SupportTicketUi::CreatePanel(string $successUrl): void
Render a panel with an action form that collects an email, phone and message, inserts an anonymous support ticket on submit, and redirects to the success url.
| Name | Type | Description |
|---|---|---|
$successUrl | string | The url to redirect to after the ticket is submitted. |
Returns void