Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
yandexdirectlive.php
1
<?
8
namespace
Bitrix\Seo\Engine
;
9
10
use
Bitrix\Main\Context
;
11
use
Bitrix\Seo\Engine
;
12
use
Bitrix\Seo\IEngine
;
13
use
Bitrix\Main\Text
;
14
15
if
(!defined(
'YANDEX_DIRECT_LIVE_API_URL'
))
16
{
17
define(
'YANDEX_DIRECT_LIVE_API_URL'
,
'https://api.direct.yandex.ru/live/v4/json/'
);
18
}
19
25
class
YandexDirectLive
extends
Engine\YandexDirect
implements
IEngine
26
{
27
const
API_URL
= YANDEX_DIRECT_LIVE_API_URL;
28
29
const
METHOD_STAT_BANNER
=
'GetBannersStat'
;
30
31
const
MAX_STAT_DAYS_DELTA
= 7;
32
33
const
ERROR_WRONG_CURRENCY
= 245;
34
35
public
$allowedCurrency
= array(
'RUB'
,
'CHF'
,
'EUR'
,
'KZT'
,
'TRY'
,
'UAH'
,
'USD'
);
36
48
public
function
getBannerStats
(array $params)
49
{
50
$result = $this->
query
(
""
, static::METHOD_STAT_BANNER, $params);
51
$result =
YandexJson::decode
($result->getResult());
52
53
if
(!empty($result[
'error_code'
]))
54
{
55
throw
new
YandexDirectException
($result);
56
}
57
58
return
$result[
"data"
];
59
}
60
}
Bitrix\Main\Web\Json\decode
static decode($data)
Definition
json.php:53
Bitrix\Seo\Engine\YandexDirectException
Definition
yandexdirectexception.php:7
Bitrix\Seo\Engine\YandexDirect
Definition
yandexdirect.php:32
Bitrix\Seo\Engine\YandexDirect\query
query($scope, $method="GET", $param=NULL, $skipRefreshAuth=false)
Definition
yandexdirect.php:725
Bitrix\Seo\Engine\YandexDirectLive
Definition
yandexdirectlive.php:26
Bitrix\Seo\Engine\YandexDirectLive\$allowedCurrency
$allowedCurrency
Definition
yandexdirectlive.php:35
Bitrix\Seo\Engine\YandexDirectLive\ERROR_WRONG_CURRENCY
const ERROR_WRONG_CURRENCY
Definition
yandexdirectlive.php:33
Bitrix\Seo\Engine\YandexDirectLive\METHOD_STAT_BANNER
const METHOD_STAT_BANNER
Definition
yandexdirectlive.php:29
Bitrix\Seo\Engine\YandexDirectLive\MAX_STAT_DAYS_DELTA
const MAX_STAT_DAYS_DELTA
Definition
yandexdirectlive.php:31
Bitrix\Seo\Engine\YandexDirectLive\API_URL
const API_URL
Definition
yandexdirectlive.php:27
Bitrix\Seo\Engine\YandexDirectLive\getBannerStats
getBannerStats(array $params)
Definition
yandexdirectlive.php:48
Bitrix\Seo\IEngine
Definition
iengine.php:11
Bitrix\Main\Context
Definition
culture.php:9
Bitrix\Main\Text
Definition
base32.php:2
Bitrix\Seo\Engine
Definition
bitrix.php:9
modules
seo
lib
engine
yandexdirectlive.php
Создано системой
1.10.0