1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
servicequeue.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Seo\BusinessSuite\Utils;
4
5
use Bitrix\Seo\BusinessSuite\Internals;
6
7
final
class
ServiceQueue
8
{
10
private
static
$instancePool = [];
11
13
private
$head;
14
16
private
$values;
17
18
public
static
function
getInstance
(
string
$type
) : self
19
{
20
if
(!array_key_exists(
$type
,static::$instancePool))
21
{
22
static::$instancePool[
$type
] =
new
static
(
$type
);
23
}
24
return
static::$instancePool[
$type
];
25
}
26
27
private
function
__construct(
string
$type
)
28
{
29
$this->values = Internals\ServiceQueueTable::getList([
30
'select'
=> [
'ID'
,
'SERVICE_TYPE'
,
'CLIENT_ID'
,
'TYPE'
],
31
'filter'
=> [
'=TYPE'
=>
$type
],
32
'order'
=> [
'SORT'
=>
'DESC'
]
33
]);
34
$this->head = $this->
getHead
();
35
}
36
private
function
__clone()
37
{}
38
43
public
function
getHead
()
44
{
45
return
$this->head = ($this->head? $this->head : $this->values->fetch());
46
}
47
52
public
function
removeHead
()
53
{
54
if
($this->head)
55
{
56
Internals\ServiceQueueTable::delete($this->head[
'ID'
]);
57
unset($this->head);
58
}
59
}
60
}
$type
$type
Определения
options.php:106
Bitrix\Seo\BusinessSuite\Utils\ServiceQueue
Определения
servicequeue.php:8
Bitrix\Seo\BusinessSuite\Utils\ServiceQueue\getInstance
static getInstance(string $type)
Определения
servicequeue.php:18
Bitrix\Seo\BusinessSuite\Utils\ServiceQueue\getHead
getHead()
Определения
servicequeue.php:43
Bitrix\Seo\BusinessSuite\Utils\ServiceQueue\removeHead
removeHead()
Определения
servicequeue.php:52
bitrix
modules
seo
lib
businesssuite
utils
servicequeue.php
Создано системой
1.14.0