1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
accountfacebook.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Seo\LeadAds\Services
;
4
5
use
Bitrix\Seo\LeadAds\Account
;
6
use
Bitrix\Seo\LeadAds
;
7
use
Bitrix\Seo\Retargeting\Paginator
;
8
9
class
AccountFacebook
extends
Account
10
{
11
public
const
TYPE_CODE
=
LeadAds\Service::TYPE_FACEBOOK
;
12
13
public
const
URL_ACCOUNT_LIST
=
'https://www.facebook.com/bookmarks/pages'
;
14
15
public
const
URL_INFO
=
'https://www.facebook.com/business/a/lead-ads'
;
16
17
protected
static
$listRowMap
=
array
(
18
'ID'
=>
'ID'
,
19
'NAME'
=>
'NAME'
,
20
);
21
25
public
function
getList
()
26
{
27
$paginator =
new
Paginator
(
28
$this->
getRequest
(),
29
[
30
'methodName'
=>
'leadads.accounts.get'
,
31
'parameters'
=> [
32
'fields'
=> [
'id'
,
'name'
,
'category'
,
'access_token'
,
'tasks'
],
33
"params"
=> [
34
"limit"
=> 50
35
]
36
],
37
]
38
);
39
40
$result
=
null
;
41
$data
= [];
42
43
foreach
($paginator as
$request
)
44
{
45
if
(!
$request
->isSuccess())
46
{
47
return
$request
;
48
}
49
50
foreach
(
$request
->getData() as $item)
51
{
52
if
(array_intersect($item[
'tasks'
] ?? [], [
'MODERATE'
,
'CREATE_CONTENT'
,
'MANAGE'
]))
53
{
54
$data
[] = $item;
55
}
56
}
57
$result
=
$request
;
58
}
59
60
!
$result
?:
$result
->setData(
$data
);
61
62
return
$result
;
63
}
64
69
public
function
getProfile
(): ?
array
70
{
71
$response
= $this->
getRequest
()->send([
72
'methodName'
=>
'leadads.profile.get'
,
73
'parameters'
=> [
74
'fields'
=> [
'id'
,
'name'
,
'picture'
,
'link'
]
75
]
76
]);
77
78
if
(
$response
->isSuccess() &&
$data
=
$response
->fetch())
79
{
80
81
return
[
82
'ID'
=>
$data
[
'ID'
],
83
'NAME'
=>
$data
[
'NAME'
],
84
'LINK'
=>
$data
[
'LINK'
],
85
'PICTURE'
=>
$data
[
'PICTURE'
] ?
$data
[
'PICTURE'
][
'data'
][
'url'
] :
null
,
86
];
87
}
88
89
return
null
;
90
}
91
}
Bitrix\Seo\LeadAds\Account
Определения
account.php:13
Bitrix\Seo\LeadAds\Service\TYPE_FACEBOOK
const TYPE_FACEBOOK
Определения
service.php:18
Bitrix\Seo\LeadAds\Services\AccountFacebook
Определения
accountfacebook.php:10
Bitrix\Seo\LeadAds\Services\AccountFacebook\$listRowMap
static $listRowMap
Определения
accountfacebook.php:17
Bitrix\Seo\LeadAds\Services\AccountFacebook\TYPE_CODE
const TYPE_CODE
Определения
accountfacebook.php:11
Bitrix\Seo\LeadAds\Services\AccountFacebook\URL_ACCOUNT_LIST
const URL_ACCOUNT_LIST
Определения
accountfacebook.php:13
Bitrix\Seo\LeadAds\Services\AccountFacebook\URL_INFO
const URL_INFO
Определения
accountfacebook.php:15
Bitrix\Seo\LeadAds\Services\AccountFacebook\getList
getList()
Определения
accountfacebook.php:25
Bitrix\Seo\LeadAds\Services\AccountFacebook\getProfile
getProfile()
Определения
accountfacebook.php:69
Bitrix\Seo\Retargeting\BaseApiObject\$request
$request
Определения
baseapiobject.php:10
Bitrix\Seo\Retargeting\BaseApiObject\getRequest
getRequest()
Определения
baseapiobject.php:44
Bitrix\Seo\Retargeting\Paginator
Определения
paginator.php:6
$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
$result
$result
Определения
get_property_values.php:14
Bitrix\Seo\LeadAds\Services
Определения
accountfacebook.php:3
Bitrix\Seo\LeadAds
Определения
account.php:3
$response
$response
Определения
result.php:21
bitrix
modules
seo
lib
leadads
services
accountfacebook.php
Создано системой
1.14.0