Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
logsubscribe.php
1<?php
9
13
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,
51 ),
52 'select' => array('USER_ID')
53 ));
54 while($subscribeFields = $res->fetch())
55 {
56 \Bitrix\Pull\MobileCounter::send($subscribeFields['USER_ID']);
57 }
58 }
59}
static getList(array $parameters=array())