1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
agent.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\Queue
;
4
5
use
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\CounterController
;
6
7
class
Agent
8
{
9
private
static
bool
$processing =
false
;
10
11
public
static
function
execute
()
12
{
13
if
(self::$processing)
14
{
15
return
self::getAgentName();
16
}
17
18
self::$processing =
true
;
19
20
$queue =
Queue::getInstance
();
21
$rows
= $queue->get(
CounterController::STEP_LIMIT
);
22
23
if
(empty(
$rows
))
24
{
25
self::$processing =
false
;
26
return
''
;
27
}
28
29
foreach
(
$rows
as $row)
30
{
31
$userId
= (int)$row[
'USER_ID'
];
32
(
new
CounterController
(
$userId
))->processQueueItem($row);
33
}
34
35
$queue->done();
36
37
self::$processing =
false
;
38
39
return
self::getAgentName();
40
}
41
42
public
function
__construct
()
43
{
44
45
}
46
47
public
function
addAgent
(): void
48
{
49
$res
= \CAgent::GetList(
50
[
'ID'
=>
'DESC'
],
51
[
52
'=NAME'
=> self::getAgentName()
53
]
54
);
55
if
(
$res
->Fetch())
56
{
57
return
;
58
}
59
60
\CAgent::AddAgent(
61
self::getAgentName(),
62
'socialnetwork'
,
63
'N'
,
64
0,
65
''
,
66
'Y'
,
67
''
68
);
69
}
70
71
public
function
removeAgent
(): void
72
{
73
\CAgent::RemoveAgent(self::getAgentName(),
'socialnetwork'
);
74
}
75
76
private
static
function
getAgentName(): string
77
{
78
return
static::class .
"::execute();"
;
79
}
80
}
$userId
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения
check_mail.php:18
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\CounterController
Определения
countercontroller.php:15
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\CounterController\STEP_LIMIT
const STEP_LIMIT
Определения
countercontroller.php:18
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\Queue\Agent
Определения
agent.php:8
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\Queue\Agent\__construct
__construct()
Определения
agent.php:42
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\Queue\Agent\removeAgent
removeAgent()
Определения
agent.php:71
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\Queue\Agent\addAgent
addAgent()
Определения
agent.php:47
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\Queue\Agent\execute
static execute()
Определения
agent.php:11
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\Queue\Queue\getInstance
static getInstance()
Определения
queue.php:30
$res
$res
Определения
filter_act.php:7
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\Queue
Определения
agent.php:3
$rows
$rows
Определения
options.php:264
bitrix
modules
socialnetwork
lib
internals
livefeed
counter
queue
agent.php
Создано системой
1.14.0