Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
spacelistsender.php
1<?php
2
4
11
12final class SpaceListSender
13{
14 public const EVENT_MAP = [
18 ];
19
20 public function send(Event $event): void
21 {
22 if (!ModuleManager::isModuleInstalled('pull') || !Loader::includeModule('pull'))
23 {
24 return;
25 }
26
27
28 if (key_exists($event->getType(), self::EVENT_MAP))
29 {
30 $recipients = [$event->getUserId()];
31
32 $userId = $event->getUserId();
33 $spaceId = $event->getGroupId();
34
35 PushService::addEvent($recipients, [
36 'module_id' => PushService::MODULE_NAME,
37 'command' => PushEventDictionary::getPushEventType(self::EVENT_MAP[$event->getType()]),
38 'params' => [
39 'USER_ID' => $userId,
40 'GROUP_ID' => $spaceId,
41 ],
42 ]);
43 }
44 }
45}
static isModuleInstalled($moduleName)