1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
accountfacebook.php
См. документацию.
1
<?
2
3
namespace
Bitrix\Seo\Retargeting\Services
;
4
5
use
Bitrix\Main\Application
;
6
use \Bitrix\Seo\Retargeting\Account;
7
8
class
AccountFacebook
extends
Account
9
{
10
const
TYPE_CODE
=
'facebook'
;
11
12
const
REGIONS_LIST_CACHE_TTL
= 60*60*24*30;
// 1 month
13
14
protected
static
$listRowMap
=
array
(
15
'ID'
=>
'ACCOUNT_ID'
,
16
'NAME'
=>
'NAME'
,
17
);
18
19
public
function
getList
()
20
{
21
return
$this->
getRequest
()->send(
array
(
22
'methodName'
=>
'retargeting.account.list'
,
23
'parameters'
=>
array
()
24
));
25
}
26
27
public
function
getProfile
()
28
{
29
$response
= $this->
getRequest
()->send(
array
(
30
'methodName'
=>
'retargeting.profile'
,
31
'parameters'
=>
array
()
32
));
33
34
if
(
$response
->isSuccess())
35
{
36
$data
=
$response
->fetch();
37
return
array
(
38
'ID'
=>
$data
[
'ID'
],
39
'NAME'
=>
$data
[
'NAME'
],
40
'LINK'
=>
$data
[
'LINK'
],
41
'PICTURE'
=>
$data
[
'PICTURE'
] ?
$data
[
'PICTURE'
][
'data'
][
'url'
] :
null
,
42
);
43
}
44
45
return
null
;
46
}
47
48
public
function
getRegionsList
()
49
{
50
$cache = Application::getInstance()->getManagedCache();
51
$cacheId =
'seo|facebook|audience|region_list|'
.LANGUAGE_ID;
52
$data
= [];
53
54
if
($cache->read(static::REGIONS_LIST_CACHE_TTL, $cacheId))
55
{
56
$data
= $cache->get($cacheId);
57
}
58
else
59
{
60
$result
= $this->
getRequest
()->send(
array
(
61
'methodName'
=>
'retargeting.audience.regions'
,
62
'parameters'
=>
array
()
63
));
64
65
if
(
$result
->isSuccess())
66
{
67
foreach
(
$result
->getData() as
$region
)
68
{
69
$data
[] = [
70
'id'
=>
$region
[
'key'
],
71
'name'
=>
$region
[
'name'
]
72
];
73
}
74
usort(
$data
,
function
(
$a
, $b)
75
{
76
return
strcmp(
$a
[
'name'
], $b[
'name'
]);
77
});
78
$cache->set($cacheId,
$data
);
79
}
80
}
81
82
return
$data
;
83
}
84
}
Bitrix\Main\Application
Определения
application.php:30
Bitrix\Seo\Retargeting\Account
Определения
account.php:8
Bitrix\Seo\Retargeting\BaseApiObject\getRequest
getRequest()
Определения
baseapiobject.php:44
Bitrix\Seo\Retargeting\Services\AccountFacebook
Определения
accountfacebook.php:9
Bitrix\Seo\Retargeting\Services\AccountFacebook\$listRowMap
static $listRowMap
Определения
accountfacebook.php:14
Bitrix\Seo\Retargeting\Services\AccountFacebook\TYPE_CODE
const TYPE_CODE
Определения
accountfacebook.php:10
Bitrix\Seo\Retargeting\Services\AccountFacebook\getList
getList()
Определения
accountfacebook.php:19
Bitrix\Seo\Retargeting\Services\AccountFacebook\getRegionsList
getRegionsList()
Определения
accountfacebook.php:48
Bitrix\Seo\Retargeting\Services\AccountFacebook\REGIONS_LIST_CACHE_TTL
const REGIONS_LIST_CACHE_TTL
Определения
accountfacebook.php:12
Bitrix\Seo\Retargeting\Services\AccountFacebook\getProfile
getProfile()
Определения
accountfacebook.php:27
$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
$region
$region
Определения
.description.php:13
Bitrix\Seo\Retargeting\Services
Определения
accountfacebook.php:3
$a
else $a
Определения
template.php:137
$response
$response
Определения
result.php:21
bitrix
modules
seo
lib
retargeting
services
accountfacebook.php
Создано системой
1.14.0