1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
responsefacebook.php
См. документацию.
1<?php
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\PagingInterface;
9use \Bitrix\Seo\Retargeting\Response;
10
11Loc::loadMessages(__FILE__);
12
14{
15 public const TYPE_CODE = 'facebook';
16
18 protected $pagingData;
19
26 public function parse($data) : void
27 {
28 $parsed = is_array($data) ? $data : Json::decode($data);
29
30 if ($parsed['error'])
31 {
32 $errorText = (isset($parsed['error']['error_user_msg']) && $parsed['error']['error_user_msg'])
33 ? $parsed['error']['error_user_msg']
34 : $parsed['error']['message']
35 ;
36
37 if ($errorText === '(#100) The parameter follow_up_action_url is required')
38 {
39 $errorText = Loc::getMessage('SEO_RETARGETING_SERVICE_RESPONSE_FACEBOOK_ERROR_URL_REQUIRED');
40 }
41 if ($errorText === 'To create or edit a Custom Audience made from a customer list, your admin needs to add this ad account to a business.')
42 {
43 $errorText = Loc::getMessage('SEO_RETARGETING_SERVICE_RESPONSE_FACEBOOK_ERROR_ADD_TO_BUSINESS');
44 }
45
46 $this->addError(
47 new Error(
48 Loc::getMessage('SEO_RETARGETING_SERVICE_RESPONSE_FACEBOOK_ERROR') . ': ' . $errorText,
49 $parsed['error']['code']
50 )
51 );
52 }
53
54 if ($parsed['data'])
55 {
56 $this->setData($parsed['data']);
57 }
58 elseif (!isset($parsed['error']))
59 {
60 $this->setData($parsed);
61 }
62
63 if (isset($parsed['paging']))
64 {
65 $this->pagingData = $parsed['paging'];
66 }
67 }
68
76 {
77 if (isset($this->pagingData['next'], $this->pagingData['cursors']['after']))
78 {
79 $params['parameters']['params']['after'] = $this->pagingData['cursors']['after'];
80
81 return $params;
82 }
83
84 return null;
85 }
86}
Определения 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
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799