Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
cache.php
1
<?php
2
namespace
Bitrix\Location\Common
;
3
4
use
Bitrix\Main\Data
;
5
use
Bitrix\Main\EventManager
;
6
12
abstract
class
Cache
13
{
15
protected
$cache
;
16
24
public
function
__construct
(
int
$ttl,
string
$cacheId, Data\
Cache
$cache
,
EventManager
$eventManager)
25
{
26
$cacheDir =
'/location'
;
27
$this->cache =
$cache
;
28
29
if
($this->cache->initCache($ttl, $cacheId, $cacheDir))
30
{
31
$this->
loadDataFromCache
();
32
}
33
34
$eventManager->
addEventHandler
(
'main'
,
'OnAfterEpilog'
, [$this,
'saveDataToCache'
]);
35
}
36
37
abstract
protected
function
loadDataFromCache
(): void;
38
abstract
public
function
saveDataToCache
(): void;
39
}
Bitrix\Location\Common\Cache
Definition
cache.php:13
Bitrix\Location\Common\Cache\saveDataToCache
saveDataToCache()
Bitrix\Location\Common\Cache\__construct
__construct(int $ttl, string $cacheId, Data\Cache $cache, EventManager $eventManager)
Definition
cache.php:24
Bitrix\Location\Common\Cache\loadDataFromCache
loadDataFromCache()
Bitrix\Location\Common\Cache\$cache
$cache
Definition
cache.php:15
Bitrix\Main\EventManager
Definition
eventmanager.php:15
Bitrix\Main\EventManager\addEventHandler
addEventHandler($fromModuleId, $eventType, $callback, $includeFile=false, $sort=100)
Definition
eventmanager.php:105
Bitrix\Location\Common
Definition
baseservice.php:3
Bitrix\Main\Data
Definition
aliases.php:105
modules
location
lib
common
cache.php
Создано системой
1.10.0