File: /home/cafsindia/help.cafsindia.com/vendor/uvdesk/core-framework/Workflow/Actions/Ticket/AddNote.php
<?php
namespace Webkul\UVDesk\CoreFrameworkBundle\Workflow\Actions\Ticket;
use Webkul\UVDesk\AutomationBundle\Workflow\FunctionalGroup;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Webkul\UVDesk\CoreFrameworkBundle\Entity\Ticket;
use Webkul\UVDesk\AutomationBundle\Workflow\Action as WorkflowAction;
use Webkul\UVDesk\AutomationBundle\Workflow\Event;
use Webkul\UVDesk\AutomationBundle\Workflow\Events\TicketActivity;
class AddNote extends WorkflowAction
{
public static function getId()
{
return 'uvdesk.agent.add_note';
}
public static function getDescription()
{
return "Add Note";
}
public static function getFunctionalGroup()
{
return FunctionalGroup::TICKET;
}
public static function getOptions(ContainerInterface $container)
{
return [];
}
public static function applyAction(ContainerInterface $container, Event $event, $value = null)
{
if (!$event instanceof TicketActivity) {
return;
} else {
$ticket = $event->getTicket();
if (empty($ticket)) {
return;
}
}
$params = [
'ticket' => $ticket,
'message' => $value,
'source' => 'website',
'threadType' => 'note',
'createdBy' => 'System',
];
$container->get('ticket.service')->createThread($ticket, $params);
}
}