Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
base.php
1
<?php
2
3
namespace
Bitrix\Rest\Preset\Data
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
11
abstract
class
Base
12
{
13
protected
const
CACHE_TIME
= 86400;
14
private
const
POSTFIX_MESSAGE_CODE =
'.MESSAGE_CODE'
;
15
22
protected
static
function
changeMessage
($data)
23
{
24
if
(is_array($data))
25
{
26
foreach
($data as $key => $value)
27
{
28
if
(is_array($value))
29
{
30
$data[$key] = static::changeMessage($value);
31
}
32
elseif (mb_strpos($key, self::POSTFIX_MESSAGE_CODE) !==
false
)
33
{
34
[$code] = explode(self::POSTFIX_MESSAGE_CODE, $key, 2);
35
$message =
Loc::getMessage
($value);
36
if
(!empty($message))
37
{
38
$data[$code] = $message;
39
}
40
}
41
}
42
}
43
44
return
$data;
45
}
46
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Rest\Preset\Data\Base
Definition
base.php:12
Bitrix\Rest\Preset\Data\Base\CACHE_TIME
const CACHE_TIME
Definition
base.php:13
Bitrix\Rest\Preset\Data\Base\changeMessage
static changeMessage($data)
Definition
base.php:22
Bitrix\Rest\Preset\Data
Definition
base.php:3
modules
rest
lib
preset
data
base.php
Создано системой
1.10.0