1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
forum.php
См. документацию.
1
<?
2
namespace
Bitrix\Forum\Statistic
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Main\Localization\Loc
;
6
7
class
Forum
extends
Main\Update\Stepper
8
{
9
protected
static
$limit
= 1;
10
protected
static
$moduleId
=
"forum"
;
11
12
public
static
function
getTitle
()
13
{
14
return
Loc::getMessage(
"FORUM_STEPPER_TITLE"
);
15
}
16
17
public
function
execute
(
array
&
$option
)
18
{
19
$option
[
"steps"
] = 1;
20
$option
[
"count"
] = 1;
21
if
(self::do() > 0)
22
{
23
return
self::FINISH_EXECUTION;
24
}
25
return
self::CONTINUE_EXECUTION;
26
}
27
28
private
static
function
do
()
29
{
30
$limit = self::$limit;
31
$dbRes
=
Main\Application::getConnection
()->query(<<<SQL
32
SELECT ID, ENTITY_ID
33
FROM b_forum_service_statistic_queue
34
WHERE ENTITY_TYPE=
'FORUM'
35
ORDER BY ID ASC
36
LIMIT {$limit}
37
SQL
38
);
39
40
$last =
null
;
41
while
(
$res
=
$dbRes
->fetch())
42
{
43
\Bitrix\Forum\Forum::getById(
$res
[
"ENTITY_ID"
])->calculateStatistic();
44
$last =
$res
;
45
}
46
47
if
($last)
48
{
49
Main\Application::getConnection
()->queryExecute(<<<SQL
50
DELETE FROM b_forum_service_statistic_queue WHERE ID >= {$last[
'ID'
]} AND ENTITY_TYPE=
'FORUM'
51
SQL
52
);
53
}
54
return
$limit
;
55
}
56
57
public
static
function
run
(
int
$forumId)
58
{
59
Main\Application::getConnection
()->queryExecute(<<<SQL
60
INSERT IGNORE INTO b_forum_service_statistic_queue (ENTITY_TYPE, ENTITY_ID) VALUES (
'FORUM'
, {$forumId});
61
SQL
62
);
63
self::bind(0);
64
}
65
}
Bitrix\Forum\Statistic\Forum\run
static run(int $forumId)
Определения
forum.php:57
Bitrix\Forum\Statistic\Forum\execute
execute(array &$option)
Определения
forum.php:17
Bitrix\Forum\Statistic\Forum\$moduleId
static $moduleId
Определения
forum.php:10
Bitrix\Forum\Statistic\Forum\$limit
static $limit
Определения
forum.php:9
Bitrix\Forum\Statistic\Forum\getTitle
static getTitle()
Определения
forum.php:12
Bitrix\Main\Application\getConnection
static getConnection($name="")
Определения
application.php:638
Bitrix\Main\Localization\Loc
Определения
loc.php:12
Bitrix\Main\Update\Stepper
Определения
stepper.php:29
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$res
$res
Определения
filter_act.php:7
Bitrix\Forum\Statistic
Определения
forum.php:2
Bitrix\Forum
Bitrix\Main
$option
$option
Определения
options.php:1711
$dbRes
$dbRes
Определения
yandex_detail.php:168
bitrix
modules
forum
lib
statistic
forum.php
Создано системой
1.14.0