1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
responsevkads.php
См. документацию.
1<?php
2
3namespace Bitrix\Seo\Retargeting\Services;
4
5use \Bitrix\Main\Error;
6use \Bitrix\Main\Localization\Loc;
7use Bitrix\Main\Text\Encoding;
8use \Bitrix\Main\Web\Json;
9use \Bitrix\Seo\Retargeting\Response;
10
11Loc::loadMessages(__FILE__);
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 . ': '
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}
Определения error.php:15
Определения response.php:5
$data['IS_AVAILABLE']
Определения .description.php:13
$result
Определения get_property_values.php:14
while($arParentIBlockProperty=$dbParentIBlockProperty->Fetch()) $errorMessage
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393