1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
accountvkads.php
См. документацию.
1
<?
2
3
namespace
Bitrix\Seo\Retargeting\Services;
4
5
use Bitrix\Main\Context;
6
use Bitrix\Main\Web\Json;
7
use Bitrix\Main\Web\Uri;
8
use \Bitrix\Seo\Retargeting\Account;
9
use Bitrix\Main\Result;
10
use Bitrix\Main\Type\Date;
11
12
class
AccountVkads
extends
Account
13
{
14
const
TYPE_CODE
=
'vkads'
;
15
16
protected
static
$listRowMap
=
array
(
17
'ID'
=>
'ACCOUNT_ID'
,
18
'NAME'
=>
'NAME'
,
19
);
20
21
public
function
getList
()
22
{
23
$response
= $this->
getRequest
()->send(
array
(
24
'methodName'
=>
'retargeting.account.list'
,
25
'parameters'
=>
array
()
26
));
27
$data
=
$response
->getData();
28
$data
= array_values(array_filter(
$data
,
function
($item) {
29
return
($item[
'account_type'
] ==
'general'
);
// only "general" is supported
30
}));
31
$response
->setData(
$data
);
32
return
$response
;
33
}
34
35
public
function
getProfile
()
36
{
37
$response
= $this->
getRequest
()->send(
array
(
38
'methodName'
=>
'analytics.profile'
,
39
'parameters'
=> []
40
));
41
42
if
(
43
$response
->isSuccess()
44
&& (
$data
=
$response
->fetch())
45
)
46
{
47
$result
= [
48
'ID'
=>
$data
[
'ID'
],
49
'NAME'
=>
$data
[
'FIRST_NAME'
] .
' '
.
$data
[
'LAST_NAME'
],
50
'LINK'
=>
'https://ads.vk.com/hq/budget/transactions/'
,
51
];
52
53
$result
[
'PICTURE'
] = (Context::getCurrent()->getRequest()->isHttps() ?
'https'
:
'http'
)
54
.
'://'
55
. Context::getCurrent()->getServer()->getHttpHost() .
'/bitrix/images/seo/integration/vklogo.svg'
;
56
57
return
$result
;
58
}
59
60
return
null
;
61
}
62
}
Bitrix\Seo\Retargeting\Account
Определения
account.php:8
Bitrix\Seo\Retargeting\BaseApiObject\getRequest
getRequest()
Определения
baseapiobject.php:44
Bitrix\Seo\Retargeting\Services\AccountVkads
Определения
accountvkads.php:13
Bitrix\Seo\Retargeting\Services\AccountVkads\$listRowMap
static $listRowMap
Определения
accountvkads.php:16
Bitrix\Seo\Retargeting\Services\AccountVkads\TYPE_CODE
const TYPE_CODE
Определения
accountvkads.php:14
Bitrix\Seo\Retargeting\Services\AccountVkads\getList
getList()
Определения
accountvkads.php:21
Bitrix\Seo\Retargeting\Services\AccountVkads\getProfile
getProfile()
Определения
accountvkads.php:35
$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
$response
$response
Определения
result.php:21
bitrix
modules
seo
lib
retargeting
services
accountvkads.php
Создано системой
1.14.0