TicketEvent events
21 FeatherPanel plugin events on TicketEvent (20 emitted by the core): the event names, the arguments each listener gets, where they fire and a PHP listener for each.
Last synced from FeatherPanel 15b94e9 on .
On this page
Part of the plugin events reference. Listeners get the payload values as positional arguments in the order shown, cannot cancel the action, and must catch their own exceptions. 1 of these events are declared but no code emits them yet; they are marked not emitted.
Setup
Import TicketEvent in your entry class and register listeners in processEvents():
<?php
namespace App\Addons\myplugin;
use App\App;
use App\Plugins\AppPlugin;
use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\TicketEvent;
class MyPlugin implements AppPlugin
{
public static function processEvents(PluginEvents $event): void
{
$event->on(TicketEvent::onTicketAttachmentDeleted(), function ($ticket, $attachmentId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:attachment:deleted ' . json_encode(['ticket' => $ticket, 'attachment_id' => $attachmentId, 'user_uuid' => $userUuid]));
});
}
public static function pluginInstall(): void
{
}
public static function pluginUninstall(): void
{
}
}TicketEvent::onTicketAttachmentCreated()
Docblock: array ticket data, array attachment data, int attachment id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | attachment | $attachment | arrayfrom docblock |
| 3 | attachment_id | $attachmentId | intfrom docblock |
| 4 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketAttachmentCreated(), function ($ticket, $attachment, $attachmentId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:attachment:created ' . json_encode(['ticket' => $ticket, 'attachment' => $attachment, 'attachment_id' => $attachmentId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketAttachmentDeleted()
Docblock: array ticket data, int attachment id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | attachment_id | $attachmentId | int |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketAttachmentDeleted(), function ($ticket, $attachmentId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:attachment:deleted ' . json_encode(['ticket' => $ticket, 'attachment_id' => $attachmentId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketAttachmentUpdated()
Docblock: array ticket data, array attachment data, array updated data, int attachment id, string user uuid.
$event->on(TicketEvent::onTicketAttachmentUpdated(), function (...$args): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:attachment:updated ' . json_encode($args));
});No code emits this event yet, so the arguments are unknown. The listener accepts any.
TicketEvent::onTicketCategoryCreated()
Docblock: array category data, int category id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | category | $category | arrayfrom docblock |
| 2 | category_id | $categoryId | intfrom docblock |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketCategoryCreated(), function ($category, $categoryId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:category:created ' . json_encode(['category' => $category, 'category_id' => $categoryId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketCategoryDeleted()
Docblock: array category data, int category id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | category | $category | arrayfrom docblock |
| 2 | category_id | $categoryId | int |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketCategoryDeleted(), function ($category, $categoryId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:category:deleted ' . json_encode(['category' => $category, 'category_id' => $categoryId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketCategoryUpdated()
Docblock: array category data, array updated data, int category id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | category | $category | arrayfrom docblock |
| 2 | updated_data | $updatedData | arrayfrom docblock |
| 3 | category_id | $categoryId | int |
| 4 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketCategoryUpdated(), function ($category, $updatedData, $categoryId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:category:updated ' . json_encode(['category' => $category, 'updated_data' => $updatedData, 'category_id' => $categoryId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketClosed()
Docblock: array ticket data, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | user_uuid | $userUuid | stringfrom docblock |
When it fires (2 sites)
$event->on(TicketEvent::onTicketClosed(), function ($ticket, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:closed ' . json_encode(['ticket' => $ticket, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketCreated()
Docblock: array ticket data, int ticket id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | ticket_id | $ticketId | intfrom docblock |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (3 sites)
$event->on(TicketEvent::onTicketCreated(), function ($ticket, $ticketId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:created ' . json_encode(['ticket' => $ticket, 'ticket_id' => $ticketId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketDeleted()
Docblock: array ticket data, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | user_uuid | $userUuid | stringfrom docblock |
When it fires (2 sites)
$event->on(TicketEvent::onTicketDeleted(), function ($ticket, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:deleted ' . json_encode(['ticket' => $ticket, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketMessageCreated()
Docblock: array ticket data, array message data, int message id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | message | $message | arrayfrom docblock |
| 3 | message_id | $messageId | intfrom docblock |
| 4 | user_uuid | $userUuid | stringfrom docblock |
When it fires (3 sites)
$event->on(TicketEvent::onTicketMessageCreated(), function ($ticket, $message, $messageId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:message:created ' . json_encode(['ticket' => $ticket, 'message' => $message, 'message_id' => $messageId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketMessageDeleted()
Docblock: array ticket data, int message id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | message_id | $messageId | int |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (2 sites)
$event->on(TicketEvent::onTicketMessageDeleted(), function ($ticket, $messageId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:message:deleted ' . json_encode(['ticket' => $ticket, 'message_id' => $messageId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketMessageUpdated()
Docblock: array ticket data, array message data, array updated data, int message id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | message | $message | arrayfrom docblock |
| 3 | updated_data | $updatedData | arrayfrom docblock |
| 4 | message_id | $messageId | int |
| 5 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketMessageUpdated(), function ($ticket, $message, $updatedData, $messageId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:message:updated ' . json_encode(['ticket' => $ticket, 'message' => $message, 'updated_data' => $updatedData, 'message_id' => $messageId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketPriorityCreated()
Docblock: array priority data, int priority id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | priority | $priority | arrayfrom docblock |
| 2 | priority_id | $priorityId | intfrom docblock |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketPriorityCreated(), function ($priority, $priorityId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:priority:created ' . json_encode(['priority' => $priority, 'priority_id' => $priorityId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketPriorityDeleted()
Docblock: array priority data, int priority id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | priority | $priority | arrayfrom docblock |
| 2 | priority_id | $priorityId | int |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketPriorityDeleted(), function ($priority, $priorityId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:priority:deleted ' . json_encode(['priority' => $priority, 'priority_id' => $priorityId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketPriorityUpdated()
Docblock: array priority data, array updated data, int priority id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | priority | $priority | arrayfrom docblock |
| 2 | updated_data | $updatedData | arrayfrom docblock |
| 3 | priority_id | $priorityId | int |
| 4 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketPriorityUpdated(), function ($priority, $updatedData, $priorityId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:priority:updated ' . json_encode(['priority' => $priority, 'updated_data' => $updatedData, 'priority_id' => $priorityId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketReopened()
Docblock: array ticket data, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | user_uuid | $userUuid | stringfrom docblock |
When it fires (2 sites)
$event->on(TicketEvent::onTicketReopened(), function ($ticket, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:reopened ' . json_encode(['ticket' => $ticket, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketStatusChanged()
Docblock: array ticket data, string old status, string new status, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | old_status | $oldStatus | null |
| 3 | new_status | $newStatus | string |
| 4 | user_uuid | $userUuid | stringfrom docblock |
When it fires (3 sites)
$event->on(TicketEvent::onTicketStatusChanged(), function ($ticket, $oldStatus, $newStatus, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:status:changed ' . json_encode(['ticket' => $ticket, 'new_status' => $newStatus, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketStatusCreated()
Docblock: array status data, int status id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | status | $status | arrayfrom docblock |
| 2 | status_id | $statusId | intfrom docblock |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketStatusCreated(), function ($status, $statusId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:status:created ' . json_encode(['status' => $status, 'status_id' => $statusId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketStatusDeleted()
Docblock: array status data, int status id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | status | $status | arrayfrom docblock |
| 2 | status_id | $statusId | int |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketStatusDeleted(), function ($status, $statusId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:status:deleted ' . json_encode(['status' => $status, 'status_id' => $statusId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketStatusUpdated()
Docblock: array status data, array updated data, int status id, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | status | $status | arrayfrom docblock |
| 2 | updated_data | $updatedData | arrayfrom docblock |
| 3 | status_id | $statusId | int |
| 4 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketStatusUpdated(), function ($status, $updatedData, $statusId, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:status:updated ' . json_encode(['status' => $status, 'updated_data' => $updatedData, 'status_id' => $statusId, 'user_uuid' => $userUuid]));
});TicketEvent::onTicketUpdated()
Docblock: array ticket data, array updated data, string user uuid.
| # | Payload key | Listener parameter | Type |
|---|---|---|---|
| 1 | ticket | $ticket | arrayfrom docblock |
| 2 | updated_data | $updatedData | arrayfrom docblock |
| 3 | user_uuid | $userUuid | stringfrom docblock |
When it fires (1 site)
$event->on(TicketEvent::onTicketUpdated(), function ($ticket, $updatedData, $userUuid): void {
App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:ticket:updated ' . json_encode(['ticket' => $ticket, 'updated_data' => $updatedData, 'user_uuid' => $userUuid]));
});