1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
responsevkontakte.php
См. документацию.
1<?
2
3namespace Bitrix\Seo\Retargeting\Services;
4
5use Bitrix\Main\Error;
6use Bitrix\Main\Localization\Loc;
7use Bitrix\Main\Web\Json;
8use Bitrix\Seo\Retargeting\Response;
9
10Loc::loadMessages(__FILE__);
12{
13 const TYPE_CODE = 'vkontakte';
14
15 public function parse($data)
16 {
17 $parsed = is_array($data) ? $data : Json::decode($data);
18
19 if (!is_array($parsed))
20 {
21 $this->setData([]);
22
23 return;
24 }
25
26 if (isset($parsed['error']))
27 {
28 $errorMessage = ((string)($parsed['error']['error_msg'] ?? ''));
29 $errorCode = ((string)($parsed['error']['error_code'] ?? ''));
30 switch ($errorCode)
31 {
32 case '100':
33 $errorMessage = Loc::getMessage(
34 'SEO_RETARGETING_SERVICE_RESPONSE_VKONTAKTE_ERROR_100',
35 array(
36 '%code%' => htmlspecialcharsbx($parsed['error']['error_code']),
37 '%msg%' => htmlspecialcharsbx($parsed['error']['error_msg']),
38 )
39 );
40 break;
41 }
42
43 $errorMessage = Loc::getMessage('SEO_RETARGETING_SERVICE_RESPONSE_VKONTAKTE_ERROR')
44 . ': '
46 $this->addError(new Error($errorMessage, $errorCode));
47 }
48
49 $result = [];
50 if (isset($parsed['response']))
51 {
52 $result = $parsed['response'];
53 }
54 else if(!isset($parsed['error']))
55 {
56 $result = $parsed;
57 }
58
59 $this->setData(is_array($result) ? $result : array($result));
60 }
61}
Определения error.php:15
Определения response.php:5
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
while($arParentIBlockProperty=$dbParentIBlockProperty->Fetch()) $errorMessage
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701