Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
logsubscribe.php
1
<?php
8
namespace
Bitrix\Socialnetwork\Item
;
9
10
use
Bitrix\Socialnetwork\LogSubscribeTable
;
11
use
Bitrix\Socialnetwork\LogCommentTable
;
12
use
Bitrix\Main\Loader
;
13
14
class
LogSubscribe
15
{
16
public
static
function
sendPush
($params = array())
17
{
18
if
(!Loader::includeModule(
'pull'
))
19
{
20
return
false
;
21
}
22
23
$logId = (isset($params[
'logId'
]) ? intval($params[
'logId'
]) : 0);
24
$commentId = (isset($params[
'commentId'
]) ? intval($params[
'commentId'
]) : 0);
25
if
(
26
$logId <= 0
27
&& $commentId > 0
28
)
29
{
30
$res =
LogCommentTable::getList
(array(
31
'filter'
=> array(
32
'=ID'
=> $commentId
33
),
34
'select'
=> array(
'LOG_ID'
)
35
));
36
if
($logCommentFields = $res->fetch())
37
{
38
$logId = $logCommentFields[
'LOG_ID'
];
39
}
40
}
41
42
if
($logId <= 0)
43
{
44
return
false
;
45
}
46
47
$res = LogSubscribeTable::getList(array(
48
'filter'
=> array(
49
'=LOG_ID'
=> $logId,
50
'=TYPE'
=>
LogSubscribeTable::TYPE_COUNTER_COMMENT_PUSH
51
),
52
'select'
=> array(
'USER_ID'
)
53
));
54
while
($subscribeFields = $res->fetch())
55
{
56
\Bitrix\Pull\MobileCounter::send($subscribeFields[
'USER_ID'
]);
57
}
58
}
59
}
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Definition
datamanager.php:441
Bitrix\Socialnetwork\Item\LogSubscribe
Definition
logsubscribe.php:15
Bitrix\Socialnetwork\Item\LogSubscribe\sendPush
static sendPush($params=array())
Definition
logsubscribe.php:16
Bitrix\Socialnetwork\LogCommentTable
Definition
logcomment.php:30
Bitrix\Socialnetwork\LogSubscribeTable
Definition
logsubscribe.php:30
Bitrix\Socialnetwork\LogSubscribeTable\TYPE_COUNTER_COMMENT_PUSH
const TYPE_COUNTER_COMMENT_PUSH
Definition
logsubscribe.php:31
Bitrix\Socialnetwork\Item
Definition
contentviewhandler.php:9
modules
socialnetwork
lib
item
logsubscribe.php
Создано системой
1.10.0