Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
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
}
Bitrix\Seo\BusinessSuite\Utils\ServiceQueue
Definition
servicequeue.php:8
Bitrix\Seo\BusinessSuite\Utils\ServiceQueue\getInstance
static getInstance(string $type)
Definition
servicequeue.php:18
Bitrix\Seo\BusinessSuite\Utils\ServiceQueue\getHead
getHead()
Definition
servicequeue.php:43
Bitrix\Seo\BusinessSuite\Utils\ServiceQueue\removeHead
removeHead()
Definition
servicequeue.php:52
Bitrix\Seo\BusinessSuite\Internals
Definition
servicequeue.php:3
Bitrix\Seo\BusinessSuite\Utils
Definition
queueeventhandler.php:3
modules
seo
lib
businesssuite
utils
servicequeue.php
Создано системой
1.10.0