Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
pushsender.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Internals\Counter\Push
;
4
5
use
Bitrix\Main\Loader
;
6
use
Bitrix\Main\ModuleManager
;
7
use
Bitrix\Socialnetwork\Integration\Pull\PushService
;
8
9
class
PushSender
10
{
11
public
const
COMMAND_USER
=
'user_counter'
;
12
21
public
function
sendUserCounters
(array $userIds, array $countersData = []): void
22
{
23
if
(
24
!
ModuleManager::isModuleInstalled
(
'pull'
)
25
|| !Loader::includeModule(
'pull'
)
26
)
27
{
28
return
;
29
}
30
31
foreach
($userIds as $userId)
32
{
33
$pushData = $countersData;
34
$pushData[
'userId'
] = $userId;
35
36
$this->
createPush
([$userId], self::COMMAND_USER, $pushData);
37
}
38
}
39
45
public
function
createPush
(array $userIds,
string
$command, array $params): void
46
{
47
if
(!
ModuleManager::isModuleInstalled
(
'pull'
) || !Loader::includeModule(
'pull'
))
48
{
49
return
;
50
}
51
52
PushService::addEvent($userIds, [
53
'module_id'
=> PushService::MODULE_NAME,
54
'command'
=> $command,
55
'params'
=> $params
56
]);
57
}
58
}
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\Counter\Push\PushSender
Definition
pushsender.php:10
Bitrix\Socialnetwork\Internals\Counter\Push\PushSender\sendUserCounters
sendUserCounters(array $userIds, array $countersData=[])
Definition
pushsender.php:21
Bitrix\Socialnetwork\Internals\Counter\Push\PushSender\createPush
createPush(array $userIds, string $command, array $params)
Definition
pushsender.php:45
Bitrix\Socialnetwork\Internals\Counter\Push\PushSender\COMMAND_USER
const COMMAND_USER
Definition
pushsender.php:11
Bitrix\Socialnetwork\Internals\Counter\Push
Definition
pushsender.php:3
modules
socialnetwork
lib
internals
counter
push
pushsender.php
Создано системой
1.10.0