Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sanitizedbodycache.php
1<?php
2
4
6
11{
17 private const TTL = 10 * 60;
18
22 private const DIR = 'mail';
23
31 private function getId(int $messageId): string
32 {
33 return "mail_ajax_body_$messageId";
34 }
35
43 public function get(int $messageId): ?string
44 {
45 $cache = Cache::createInstance();
46 if ($cache->initCache(self::TTL, $this->getId($messageId), self::DIR))
47 {
48 return $cache->getVars();
49 }
50
51 return null;
52 }
53
62 public function set(int $messageId, string $value): void
63 {
64 $cache = Cache::createInstance();
65 $cache->initCache(self::TTL, $this->getId($messageId), self::DIR);
66 $cache->startDataCache();
67 $cache->endDataCache($value);
68 }
69
70}