1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
cachedpool.php
См. документацию.
1
<?php
2
namespace
Bitrix\Location\Common;
3
4
use Bitrix\Main\Data\Cache;
5
use Bitrix\Main\EventManager;
6
11
class
CachedPool
extends
\Bitrix\Location\Common\Cache
12
{
14
protected
$pool
;
16
protected
$cache
;
18
protected
$isItemChanged
=
false
;
19
28
public
function
__construct
(
Pool
$pool
,
int
$ttl
,
string
$cacheId,
Cache
$cache
,
EventManager
$eventManager
)
29
{
30
$this->pool =
$pool
;
31
parent::__construct(
$ttl
, $cacheId,
$cache
,
$eventManager
);
32
}
33
34
public
function
loadDataFromCache
(): void
35
{
36
$items
= $this->cache->getVars()[
'items'
];
37
if
(is_array(
$items
))
38
{
39
$this->pool->setItems(
$items
);
40
}
41
}
42
43
public
function
saveDataToCache
(): void
44
{
45
if
($this->isItemChanged)
46
{
47
$this->cache->forceRewriting(
true
);
48
$this->cache->startDataCache();
49
$this->cache->endDataCache([
'items'
=> $this->pool->getItems()]);
50
}
51
}
52
57
public
function
getItem
(
string
$key
)
58
{
59
return
$this->pool->getItem(
$key
);
60
}
61
66
public
function
addItem
(
string
$key
, $value): void
67
{
68
$this->pool->addItem(
$key
, $value);
69
$this->isItemChanged =
true
;
70
}
71
75
public
function
deleteItem
(
string
$key
): void
76
{
77
$this->pool->deleteItem(
$key
);
78
$this->isItemChanged =
true
;
79
}
80
81
public
function
cleanItems
(): void
82
{
83
$this->pool->cleanItems();
84
$this->isItemChanged =
true
;
85
}
86
}
Bitrix\Location\Common\CachedPool
Определения
cachedpool.php:12
Bitrix\Location\Common\CachedPool\$pool
$pool
Определения
cachedpool.php:14
Bitrix\Location\Common\CachedPool\saveDataToCache
saveDataToCache()
Определения
cachedpool.php:43
Bitrix\Location\Common\CachedPool\cleanItems
cleanItems()
Определения
cachedpool.php:81
Bitrix\Location\Common\CachedPool\getItem
getItem(string $key)
Определения
cachedpool.php:57
Bitrix\Location\Common\CachedPool\loadDataFromCache
loadDataFromCache()
Определения
cachedpool.php:34
Bitrix\Location\Common\CachedPool\deleteItem
deleteItem(string $key)
Определения
cachedpool.php:75
Bitrix\Location\Common\CachedPool\__construct
__construct(Pool $pool, int $ttl, string $cacheId, Cache $cache, EventManager $eventManager)
Определения
cachedpool.php:28
Bitrix\Location\Common\CachedPool\$cache
$cache
Определения
cachedpool.php:16
Bitrix\Location\Common\CachedPool\addItem
addItem(string $key, $value)
Определения
cachedpool.php:66
Bitrix\Location\Common\CachedPool\$isItemChanged
$isItemChanged
Определения
cachedpool.php:18
Bitrix\Location\Common\Pool
Определения
pool.php:9
Bitrix\Main\Data\Cache\$ttl
int $ttl
Определения
cache.php:22
Bitrix\Main\EventManager
Определения
eventmanager.php:13
Bitrix\Main\Data\Cache
Определения
keyvalueengine.php:3
$key
if(empty($signedUserToken)) $key
Определения
quickway.php:257
$items
$items
Определения
template.php:224
$eventManager
$eventManager
Определения
include.php:412
bitrix
modules
location
lib
common
cachedpool.php
Создано системой
1.14.0