Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
account.php
1
<?
2
3
namespace
Bitrix\Seo\Retargeting
;
4
5
use
Bitrix\Main\Application
;
6
7
abstract
class
Account
extends
BaseApiObject
8
{
9
const
PROFILE_INFO_CACHE_TTL
= 86400;
10
11
protected
static
$listRowMap
= array(
12
'ID'
=>
'ID'
,
13
'NAME'
=>
'NAME'
,
14
);
15
21
public
function
getProfileCached
()
22
{
23
$cache =
Application::getInstance
()->getManagedCache();
24
25
$cacheId = $this->
getCacheId
();
26
if
($cache->read(static::PROFILE_INFO_CACHE_TTL, $cacheId))
27
{
28
$profile = $cache->get($cacheId);
29
}
30
else
31
{
32
$profile = $this->
getProfile
();
33
$cache->set($cacheId, $profile);
34
}
35
36
if
($profile)
37
{
38
$authProvider =
Service::getAuthAdapter
(static::TYPE_CODE);
39
$authProvider->setService($this->service);
40
$profile[
'CLIENT_ID'
] = $authProvider->getClientId();
41
}
42
return
$profile;
43
}
44
50
public
function
clearCache
()
51
{
52
$cacheId = $this->
getCacheId
();
53
$cache =
Application::getInstance
()->getManagedCache();
54
$cache->Clean($cacheId);
55
}
56
61
protected
function
getCacheId
()
62
{
63
$cacheId =
'seo|account_profile|'
;
64
$service
=
$this->service
;
65
$cacheId .=
$service
? $service::getEngineCode(static::TYPE_CODE) : static::TYPE_CODE;
66
if
(
$service
instanceof \
Bitrix
\Seo\Retargeting\
IMultiClientService
)
67
{
68
$cacheId .=
'|'
.
$service
->getClientId();
69
}
70
return
$cacheId;
71
}
72
76
abstract
public
function
getList
();
77
81
abstract
public
function
getProfile
();
82
83
public
function
getRegionsList
()
84
{
85
return
[];
86
}
87
88
public
function
checkNewAuthInfo
(): bool
89
{
90
return
false
;
91
}
92
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getInstance
static getInstance()
Definition
application.php:95
Bitrix\Seo\Retargeting\Account
Definition
account.php:8
Bitrix\Seo\Retargeting\Account\$listRowMap
static $listRowMap
Definition
account.php:11
Bitrix\Seo\Retargeting\Account\getCacheId
getCacheId()
Definition
account.php:61
Bitrix\Seo\Retargeting\Account\PROFILE_INFO_CACHE_TTL
const PROFILE_INFO_CACHE_TTL
Definition
account.php:9
Bitrix\Seo\Retargeting\Account\getList
getList()
Bitrix\Seo\Retargeting\Account\getRegionsList
getRegionsList()
Definition
account.php:83
Bitrix\Seo\Retargeting\Account\getProfileCached
getProfileCached()
Definition
account.php:21
Bitrix\Seo\Retargeting\Account\checkNewAuthInfo
checkNewAuthInfo()
Definition
account.php:88
Bitrix\Seo\Retargeting\Account\getProfile
getProfile()
Bitrix\Seo\Retargeting\Account\clearCache
clearCache()
Definition
account.php:50
Bitrix\Seo\Retargeting\BaseApiObject
Definition
baseapiobject.php:6
Bitrix\Seo\Retargeting\BaseApiObject\$service
$service
Definition
baseapiobject.php:13
Bitrix\Seo\Retargeting\Service\getAuthAdapter
static getAuthAdapter($type)
Definition
service.php:93
Bitrix\Seo\Retargeting\IMultiClientService
Definition
imulticlientservice.php:6
Bitrix\Seo\Retargeting
Definition
account.php:3
Bitrix
modules
seo
lib
retargeting
account.php
Создано системой
1.10.0