Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
sanitizedbodycache.php
1
<?php
2
3
namespace
Bitrix\Mail\Helper\Cache
;
4
5
use
Bitrix\Main\Data\Cache
;
6
10
final
class
SanitizedBodyCache
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
}
Bitrix\Mail\Helper\Cache\SanitizedBodyCache
Definition
sanitizedbodycache.php:11
Bitrix\Main\Data\Cache
Definition
cache.php:16
Bitrix\Mail\Helper\Cache
Definition
sanitizedbodycache.php:3
modules
mail
lib
helper
cache
sanitizedbodycache.php
Создано системой
1.10.0