Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
pushdelayedconnection.php
1<?php
2
4
13
15{
21 public function process(Interfaces\Message $message): string
22 {
23 $data = $message->getBody();
24
25 $connectionId = $data[Sync\Push\Dictionary::PUSH_TYPE['connection']] ?? null;
26
27 if (empty($connectionId))
28 {
29 return self::REJECT;
30 }
31
32 try
33 {
34 $push = PushTable::getById([
35 'ENTITY_TYPE' => PushManager::TYPE_CONNECTION,
36 'ENTITY_ID' => $connectionId,
37 ])->fetchObject();
38 if ($push)
39 {
40 $result = (new PushManager())->handlePush(
41 $push->getChannelId(),
42 $push->getResourceId()
43 );
44 }
45
46 return self::ACK;
47 }
48 catch (\Exception $e)
49 {
50 return self::REJECT;
51 }
52 }
53}