1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
cache.php
См. документацию.
1<?php
2namespace Bitrix\Location\Common;
3
4use Bitrix\Main\Data;
5use Bitrix\Main\EventManager;
6
12abstract 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}
__construct(int $ttl, string $cacheId, Data\Cache $cache, EventManager $eventManager)
Определения cache.php:24
Определения aliases.php:105
$eventManager
Определения include.php:412