Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
yandexdirectcampaign.php
1<?php
2
4
9
11{
18 public static function updateSettingsAgent()
19 {
20 if (Loader::includeModule('seo') && Loader::includeModule('socialservices'))
21 {
22 $engine = new YandexDirect();
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 {
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}
static getAuth(string $engineCode)
Definition service.php:72
static isRegistered()
Definition service.php:59