Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
pushsender.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Internals\EventService\Push
;
4
5
use
Bitrix\Main\Loader
;
6
use
Bitrix\Main\ModuleManager
;
7
use
Bitrix\Socialnetwork\Integration\Pull\PushService
;
8
9
class
PushSender
10
{
15
public
static
function
sendPersonalEvent
(array $userIds,
string
$command =
''
, array $eventData = []): void
16
{
17
if
(
18
$command ===
''
19
|| !
ModuleManager::isModuleInstalled
(
'pull'
)
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
(
43
!
ModuleManager::isModuleInstalled
(
'pull'
)
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
}
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\ModuleManager
Definition
modulemanager.php:5
Bitrix\Main\ModuleManager\isModuleInstalled
static isModuleInstalled($moduleName)
Definition
modulemanager.php:67
Bitrix\Socialnetwork\Integration\Pull\PushService
Definition
pushservice.php:15
Bitrix\Socialnetwork\Internals\EventService\Push\PushSender
Definition
pushsender.php:10
Bitrix\Socialnetwork\Internals\EventService\Push\PushSender\sendPersonalEvent
static sendPersonalEvent(array $userIds, string $command='', array $eventData=[])
Definition
pushsender.php:15
Bitrix\Socialnetwork\Internals\EventService\Push\PushSender\createPush
static createPush(array $userIds, string $command, array $params)
Definition
pushsender.php:40
Bitrix\Socialnetwork\Internals\EventService\Push
Definition
pulldictionary.php:3
modules
socialnetwork
lib
internals
eventservice
push
pushsender.php
Создано системой
1.10.0