Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
accountyandex.php
1<?
2
4
5use \Bitrix\Main\Web\Json;
6use \Bitrix\Seo\Retargeting\Account;
7use \Bitrix\Seo\Retargeting\Response;
8
9class AccountYandex extends Account
10{
11 const TYPE_CODE = 'yandex';
12
13 public function getList()
14 {
15 // fake
16
17 $response = Response::create(static::TYPE_CODE);
18 $response->setData(array(array('ID' => 1)));
19
20 return $response;
21 }
22
23 public function getProfile()
24 {
25 $response = $this->getRequest()->send(array(
26 'methodName' => 'retargeting.profile',
27 'parameters' => array()
28 ));
29
30 if ($response->isSuccess())
31 {
32 $data = $response->fetch();
33 return array(
34 'ID' => $data['ID'],
35 'NAME' => $data['REAL_NAME'] ?: $data['LOGIN'],
36 'LINK' => '',
37 'PICTURE' => 'https://avatars.mds.yandex.net/get-yapic/0/0-0/islands-50',
38 );
39 }
40
41 return null;
42 }
43}