Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Task.php
1<?php
2
4
11
12class Task extends BaseController
13{
17 public function prepareAction(?Chat $chat = null, ?\Bitrix\Im\V2\Message $message = null): ?array
18 {
19 if (isset($message)) {
20 $chat = $message->getChat();
21 if (!$chat->hasAccess())
22 {
24
25 return null;
26 }
27 }
28
29 if (!isset($chat))
30 {
32
33 return null;
34 }
35
36 $taskService = new TaskService();
37 $result = $taskService->prepareDataForCreateSlider($chat, $message);
38 if (!$result->isSuccess())
39 {
40 $error = $result->getErrors()[0];
41 if (isset($error))
42 {
43 $this->addError($error);
44
45 return null;
46 }
47 }
48
49 return [
50 'link' => $result->getResult()['LINK'],
51 'params' => $result->getResult()['PARAMS']
52 ];
53 }
54}
prepareAction(?Chat $chat=null, ?\Bitrix\Im\V2\Message $message=null)
Definition Task.php:17