1 | <?php |
||
2 | |||
3 | /* |
||
4 | * @copyright 2016 Mautic Contributors. All rights reserved |
||
5 | * @author Mautic, Inc. |
||
6 | * |
||
7 | * @link https://mautic.org |
||
8 | * |
||
9 | * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html |
||
10 | */ |
||
11 | |||
12 | namespace Mautic\ChannelBundle\Controller; |
||
13 | |||
14 | use Mautic\CoreBundle\Controller\AjaxController as CommonAjaxController; |
||
15 | use Mautic\CoreBundle\Controller\AjaxLookupControllerTrait; |
||
16 | use Symfony\Component\HttpFoundation\Request; |
||
17 | |||
18 | class AjaxController extends CommonAjaxController |
||
19 | { |
||
20 | use AjaxLookupControllerTrait; |
||
21 | |||
22 | /** |
||
23 | * @param $eventId |
||
24 | * @param $contactId |
||
25 | * |
||
26 | * @return LeadEventLog|\Symfony\Component\HttpFoundation\JsonResponse |
||
27 | * |
||
28 | * @throws \Exception |
||
29 | */ |
||
30 | public function cancelQueuedMessageEventAction(Request $request) |
||
31 | { |
||
32 | $dataArray = ['success' => 0]; |
||
33 | $messageQueueId = (int) $request->request->get('channelId'); |
||
34 | $queueModel = $this->getModel('channel.queue'); |
||
35 | $queuedMessage = $queueModel->getEntity($messageQueueId); |
||
36 | if ($queuedMessage) { |
||
37 | $queuedMessage->setStatus('cancelled'); |
||
38 | $queueModel->saveEntity($queuedMessage); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
39 | $dataArray = ['success' => 1]; |
||
40 | } |
||
41 | |||
42 | return $this->sendJsonResponse($dataArray); |
||
43 | } |
||
44 | } |
||
45 |