View .md

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()

Name: featherpanel:ticket:attachment:createdemitted at 1 siteCancel or modify: nodefinition

Docblock: array ticket data, array attachment data, int attachment id, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2attachment$attachmentarrayfrom docblock
3attachment_id$attachmentIdintfrom docblock
4user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:attachment:deletedemitted at 1 siteCancel or modify: nodefinition

Docblock: array ticket data, int attachment id, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2attachment_id$attachmentIdint
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:attachment:updatednot emittedCancel or modify: nodefinition

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()

Name: featherpanel:ticket:category:createdemitted at 1 siteCancel or modify: nodefinition

Docblock: array category data, int category id, string user uuid.

#Payload keyListener parameterType
1category$categoryarrayfrom docblock
2category_id$categoryIdintfrom docblock
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:category:deletedemitted at 1 siteCancel or modify: nodefinition

Docblock: array category data, int category id, string user uuid.

#Payload keyListener parameterType
1category$categoryarrayfrom docblock
2category_id$categoryIdint
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:category:updatedemitted at 1 siteCancel or modify: nodefinition

Docblock: array category data, array updated data, int category id, string user uuid.

#Payload keyListener parameterType
1category$categoryarrayfrom docblock
2updated_data$updatedDataarrayfrom docblock
3category_id$categoryIdint
4user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:closedemitted at 2 sitesCancel or modify: nodefinition

Docblock: array ticket data, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:createdemitted at 3 sitesCancel or modify: nodefinition

Docblock: array ticket data, int ticket id, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2ticket_id$ticketIdintfrom docblock
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:deletedemitted at 2 sitesCancel or modify: nodefinition

Docblock: array ticket data, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:message:createdemitted at 3 sitesCancel or modify: nodefinition

Docblock: array ticket data, array message data, int message id, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2message$messagearrayfrom docblock
3message_id$messageIdintfrom docblock
4user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:message:deletedemitted at 2 sitesCancel or modify: nodefinition

Docblock: array ticket data, int message id, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2message_id$messageIdint
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:message:updatedemitted at 1 siteCancel or modify: nodefinition

Docblock: array ticket data, array message data, array updated data, int message id, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2message$messagearrayfrom docblock
3updated_data$updatedDataarrayfrom docblock
4message_id$messageIdint
5user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:priority:createdemitted at 1 siteCancel or modify: nodefinition

Docblock: array priority data, int priority id, string user uuid.

#Payload keyListener parameterType
1priority$priorityarrayfrom docblock
2priority_id$priorityIdintfrom docblock
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:priority:deletedemitted at 1 siteCancel or modify: nodefinition

Docblock: array priority data, int priority id, string user uuid.

#Payload keyListener parameterType
1priority$priorityarrayfrom docblock
2priority_id$priorityIdint
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:priority:updatedemitted at 1 siteCancel or modify: nodefinition

Docblock: array priority data, array updated data, int priority id, string user uuid.

#Payload keyListener parameterType
1priority$priorityarrayfrom docblock
2updated_data$updatedDataarrayfrom docblock
3priority_id$priorityIdint
4user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:reopenedemitted at 2 sitesCancel or modify: nodefinition

Docblock: array ticket data, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:status:changedemitted at 3 sitesCancel or modify: nodefinition

Docblock: array ticket data, string old status, string new status, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2old_status$oldStatusnull
3new_status$newStatusstring
4user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:status:createdemitted at 1 siteCancel or modify: nodefinition

Docblock: array status data, int status id, string user uuid.

#Payload keyListener parameterType
1status$statusarrayfrom docblock
2status_id$statusIdintfrom docblock
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:status:deletedemitted at 1 siteCancel or modify: nodefinition

Docblock: array status data, int status id, string user uuid.

#Payload keyListener parameterType
1status$statusarrayfrom docblock
2status_id$statusIdint
3user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:status:updatedemitted at 1 siteCancel or modify: nodefinition

Docblock: array status data, array updated data, int status id, string user uuid.

#Payload keyListener parameterType
1status$statusarrayfrom docblock
2updated_data$updatedDataarrayfrom docblock
3status_id$statusIdint
4user_uuid$userUuidstringfrom 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()

Name: featherpanel:ticket:updatedemitted at 1 siteCancel or modify: nodefinition

Docblock: array ticket data, array updated data, string user uuid.

#Payload keyListener parameterType
1ticket$ticketarrayfrom docblock
2updated_data$updatedDataarrayfrom docblock
3user_uuid$userUuidstringfrom 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]));
});