1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
responsefacebook.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\Web\Json;
8
use Bitrix\Seo\Retargeting\PagingInterface;
9
use \Bitrix\Seo\Retargeting\Response;
10
11
Loc::loadMessages(__FILE__);
12
13
class
ResponseFacebook
extends
Response
implements
PagingInterface
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
75
public
function
prepareRequestParams
(
array
$params
) : ?
array
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
}
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\Response
Определения
response.php:5
Bitrix\Seo\Retargeting\Services\ResponseFacebook
Определения
responsefacebook.php:14
Bitrix\Seo\Retargeting\Services\ResponseFacebook\prepareRequestParams
prepareRequestParams(array $params)
Определения
responsefacebook.php:75
Bitrix\Seo\Retargeting\Services\ResponseFacebook\TYPE_CODE
const TYPE_CODE
Определения
responsefacebook.php:15
Bitrix\Seo\Retargeting\Services\ResponseFacebook\parse
parse($data)
Определения
responsefacebook.php:26
Bitrix\Seo\Retargeting\Services\ResponseFacebook\$pagingData
$pagingData
Определения
responsefacebook.php:18
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Seo\Retargeting\PagingInterface
Определения
paginginterface.php:6
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
seo
lib
retargeting
services
responsefacebook.php
Создано системой
1.14.0