1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
agent.php
См. документацию.
1<?php
2
4
5class Agent
6{
7 private static bool $processing = false;
8
9 public static function execute()
10 {
11 if (self::$processing)
12 {
13 return self::getAgentName();
14 }
15
16 self::$processing = true;
17
18 $rowsProcessed = Queue::getInstance()->process();
19
20 self::$processing = false;
21
22 return ($rowsProcessed > 0) ? self::getAgentName() : '';
23 }
24
25 public function __construct()
26 {
27
28 }
29
30 public function addAgent(): void
31 {
32 $res = \CAgent::GetList(
33 ['ID' => 'DESC'],
34 [
35 '=NAME' => self::getAgentName()
36 ]
37 );
38 if ($res->Fetch())
39 {
40 return;
41 }
42
43 \CAgent::AddAgent(
44 self::getAgentName(),
45 'socialnetwork',
46 'N',
47 0,
48 '',
49 'Y',
50 ''
51 );
52 }
53
54 public function removeAgent(): void
55 {
56 \CAgent::RemoveAgent(self::getAgentName(), 'socialnetwork');
57 }
58
59 private static function getAgentName(): string
60 {
61 return static::class . "::execute();";
62 }
63}
$res
Определения filter_act.php:7