1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
responsevkads.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Seo\Retargeting\Services;
4
5
use \Bitrix\Main\Error;
6
use \Bitrix\Main\Localization\Loc;
7
use Bitrix\Main\Text\Encoding;
8
use \Bitrix\Main\Web\Json;
9
use \Bitrix\Seo\Retargeting\Response;
10
11
Loc::loadMessages(__FILE__);
12
class
ResponseVkads
extends
Response
13
{
14
const
TYPE_CODE
=
'vkads'
;
15
16
public
function
parse
(
$data
)
17
{
18
$parsed = is_array(
$data
) ?
$data
: Json::decode(
$data
);
19
if
($parsed[
'error'
])
20
{
21
$errorMessage
= $parsed[
'error'
][
'error_msg'
];
22
if
((
string
)$parsed[
'error'
][
'error_code'
] ===
'100'
)
23
{
24
$errorMessage
= Loc::getMessage(
25
'SEO_RETARGETING_SERVICE_RESPONSE_VKADS_ERROR_100'
,
26
[
27
'%code%'
=>
htmlspecialcharsbx
($parsed[
'error'
][
'error_code'
]),
28
'%msg%'
=>
htmlspecialcharsbx
($parsed[
'error'
][
'error_msg'
]),
29
]
30
);
31
}
32
33
$errorMessage
= Loc::getMessage(
'SEO_RETARGETING_SERVICE_RESPONSE_VKADS_ERROR'
)
34
.
': '
35
.
$errorMessage
;
36
$this->addError(
new
Error
(
$errorMessage
, $parsed[
'error'
][
'error_code'
]));
37
}
38
39
$result
= [];
40
if
($parsed[
'response'
])
41
{
42
$result
= $parsed[
'response'
];
43
}
44
elseif
(!isset($parsed[
'error'
]))
45
{
46
$result
= $parsed;
47
}
48
49
$this->setData(is_array(
$result
) ?
$result
: [
$result
]);
50
}
51
}
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\Response
Определения
response.php:5
Bitrix\Seo\Retargeting\Services\ResponseVkads
Определения
responsevkads.php:13
Bitrix\Seo\Retargeting\Services\ResponseVkads\TYPE_CODE
const TYPE_CODE
Определения
responsevkads.php:14
Bitrix\Seo\Retargeting\Services\ResponseVkads\parse
parse($data)
Определения
responsevkads.php:16
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
$result
$result
Определения
get_property_values.php:14
$errorMessage
while($arParentIBlockProperty=$dbParentIBlockProperty->Fetch()) $errorMessage
Определения
iblock_subelement_generator.php:275
htmlspecialcharsbx
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения
tools.php:2701
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
seo
lib
retargeting
services
responsevkads.php
Создано системой
1.14.0