Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
queuefactory.php
1
<?php
2
3
namespace
Bitrix\Calendar\Core\Queue\Queue
;
4
5
class
QueueFactory
6
{
7
private
static
array $cache = [];
8
9
public
function
getById
(
int
$queueId): ?
Queue
10
{
11
if
(!array_key_exists($queueId, self::$cache))
12
{
13
if
($queueName =
QueueRegistry::getNameById
($queueId))
14
{
15
self::$cache[$queueId] =
new
Queue
($queueId, $queueName);
16
}
17
else
18
{
19
self::$cache[$queueId] =
null
;
20
}
21
}
22
23
return
self::$cache[$queueId];
24
}
25
26
public
function
getByName
(
string
$queueName): ?
Queue
27
{
28
if
($queueId =
QueueRegistry::getIdByName
($queueName))
29
{
30
if
(!array_key_exists($queueId, self::$cache))
31
{
32
self::$cache[$queueId] =
new
Queue
($queueId, $queueName);
33
}
34
}
35
else
36
{
37
self::$cache[$queueId] =
null
;
38
}
39
40
return
self::$cache[$queueId];
41
}
42
}
Bitrix\Calendar\Core\Queue\Queue\QueueFactory
Definition
queuefactory.php:6
Bitrix\Calendar\Core\Queue\Queue\QueueFactory\getByName
getByName(string $queueName)
Definition
queuefactory.php:26
Bitrix\Calendar\Core\Queue\Queue\QueueFactory\getById
getById(int $queueId)
Definition
queuefactory.php:9
Bitrix\Calendar\Core\Queue\Queue\QueueRegistry\getIdByName
static getIdByName(string $name)
Definition
queueregistry.php:55
Bitrix\Calendar\Core\Queue\Queue\QueueRegistry\getNameById
static getNameById(int $id)
Definition
queueregistry.php:40
Bitrix\Calendar\Core\Queue\Interfaces\Queue
Definition
queue.php:5
Bitrix\Calendar\Core\Queue\Queue
Definition
queue.php:3
modules
calendar
lib
core
queue
queue
queuefactory.php
Создано системой
1.10.0