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