1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
yandexdirectcampaign.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Seo\Update
;
4
5
use
Bitrix\Main\Loader
;
6
use
Bitrix\Seo\Engine\YandexDirect
;
7
use
Bitrix\Seo\Engine\YandexDirectException
;
8
use
Bitrix\Seo\Service
;
9
10
class
YandexDirectCampaign
11
{
18
public
static
function
updateSettingsAgent
()
19
{
20
if
(Loader::includeModule(
'seo'
) && Loader::includeModule(
'socialservices'
))
21
{
22
$engine
=
new
YandexDirect
();
23
if
(!
Service::isRegistered
())
24
{
25
return
;
26
}
27
28
$authInfo =
Service::getAuth
(
$engine
->getCode());
29
if
(!is_array($authInfo) || empty($authInfo) || $authInfo[
'expires_in'
] <= time())
30
{
31
return
;
32
}
33
34
try
35
{
36
self::clearData
();
37
$engine
->updateCampaignManual();
38
}
39
catch
(
YandexDirectException
$e)
40
{
41
}
42
}
43
}
44
45
protected
static
function
clearData
()
46
{
47
global
$DB
;
48
$DB
->Query(
"TRUNCATE TABLE b_seo_adv_campaign"
);
49
$DB
->Query(
"TRUNCATE TABLE b_seo_adv_banner"
);
50
$DB
->Query(
"TRUNCATE TABLE b_seo_adv_group"
);
51
}
52
}
Bitrix\Main\Loader
Определения
loader.php:13
Bitrix\Seo\Engine\YandexDirectException
Определения
yandexdirectexception.php:7
Bitrix\Seo\Engine\YandexDirect
Определения
yandexdirect.php:30
Bitrix\Seo\Service\getAuth
static getAuth(string $engineCode)
Определения
service.php:78
Bitrix\Seo\Service\isRegistered
static isRegistered()
Определения
service.php:65
Bitrix\Seo\Update\YandexDirectCampaign
Определения
yandexdirectcampaign.php:11
Bitrix\Seo\Update\YandexDirectCampaign\clearData
static clearData()
Определения
yandexdirectcampaign.php:45
Bitrix\Seo\Update\YandexDirectCampaign\updateSettingsAgent
static updateSettingsAgent()
Определения
yandexdirectcampaign.php:18
$DB
global $DB
Определения
cron_frame.php:29
Bitrix\Main\Service
Bitrix\Seo\Update
Определения
yandexdirectcampaign.php:3
$engine
$engine
Определения
options.php:121
bitrix
modules
seo
lib
update
yandexdirectcampaign.php
Создано системой
1.14.0