Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
pushsender.php
1<?php
2
4
8
10{
15 public static function sendPersonalEvent(array $userIds, string $command = '', array $eventData = []): void
16 {
17 if (
18 $command === ''
20 || !Loader::includeModule('pull')
21 )
22 {
23 return;
24 }
25
26 foreach ($userIds as $userId)
27 {
28 $pushData = $eventData;
29 $pushData['userId'] = $userId;
30
31 self::createPush([ $userId ], $command, $pushData);
32 }
33 }
34
40 protected static function createPush(array $userIds, string $command, array $params): void
41 {
42 if (
44 || !Loader::includeModule('pull')
45 )
46 {
47 return;
48 }
49
50 PushService::addEvent($userIds, [
51 'module_id' => PushService::MODULE_NAME,
52 'command' => $command,
53 'params' => $params
54 ]);
55 }
56}
static isModuleInstalled($moduleName)
static sendPersonalEvent(array $userIds, string $command='', array $eventData=[])
static createPush(array $userIds, string $command, array $params)