1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
installs.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Seo\BusinessSuite\Configuration\Facebook;
4
5
use Bitrix\Main;
6
use Bitrix\Main\Application;
7
use Bitrix\Seo\BusinessSuite\Service;
8
use Bitrix\Seo\BusinessSuite\ServiceAdapter;
9
use Bitrix\Seo\BusinessSuite\AuthAdapter\IAuthSettings;
10
11
final
class
Installs
implements
IAuthSettings
12
{
13
private
const
FACEBOOK_INSTALLS_TTL = 840000;
14
public
const
FACEBOOK_INSTALLS_CACHE_ID
=
'facebook|business|installs'
;
15
17
private
static
$current;
18
20
private
$value;
21
22
private
function
__construct()
23
{}
24
25
public
static
function
load
() : ?self
26
{
27
if
(!self::$current)
28
{
29
self::$current =
new
static
();
30
$cache = Application::getInstance()->getManagedCache();
31
if
($cache->read(self::FACEBOOK_INSTALLS_TTL,self::FACEBOOK_INSTALLS_CACHE_ID))
32
{
33
self::$current->value = $cache->get(self::FACEBOOK_INSTALLS_CACHE_ID);
34
}
35
elseif
36
(
37
($adapter =
ServiceAdapter::loadFacebookService
())
38
&& (
$response
= $adapter->getExtension()->getInstalls())
39
&&
$response
->isSuccess()
40
)
41
{
42
$cache->set(self::FACEBOOK_INSTALLS_CACHE_ID, self::$current->value =
$response
->fetch());
43
}
44
}
45
46
return
self::$current;
47
}
48
49
public
function
getPixel
()
50
{
51
return
$this->value[
'PIXEL_ID'
];
52
}
53
public
function
getPages
()
54
{
55
return
$this->value[
'PAGES'
];
56
}
57
public
function
getInstagramProfiles
()
58
{
59
return
$this->value[
'INSTAGRAM_PROFILES'
];
60
}
61
public
function
getBusinessManager
()
62
{
63
return
$this->value[
'BUSINESS_MANAGER_ID'
];
64
}
65
public
function
getAdAccount
()
66
{
67
return
$this->value[
'AD_ACCOUNT_ID'
];
68
}
69
public
function
getCatalog
()
70
{
71
return
$this->value[
'CATALOG_ID'
];
72
}
73
74
public
static
function
clearCache
()
75
{
76
Application::getInstance()->getManagedCache()->clean(self::FACEBOOK_INSTALLS_CACHE_ID);
77
self::$current =
null
;
78
}
79
80
public
function
toArray
():
array
81
{
82
return
array_filter([
83
'business_manager_id'
=> $this->
getBusinessManager
(),
84
'ad_account_id'
=> $this->
getAdAccount
(),
85
'pixel_id'
=> $this->
getPixel
(),
86
'catalog_id'
=> $this->
getCatalog
(),
87
'page_id'
=> current($this->
getPages
() ?? []),
88
'ig_profile_id'
=> current($this->
getInstagramProfiles
() ?? [])
89
]);
90
}
91
}
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs
Определения
installs.php:12
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\getCatalog
getCatalog()
Определения
installs.php:69
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\toArray
toArray()
Определения
installs.php:80
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\load
static load()
Определения
installs.php:25
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\getBusinessManager
getBusinessManager()
Определения
installs.php:61
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\getAdAccount
getAdAccount()
Определения
installs.php:65
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\getInstagramProfiles
getInstagramProfiles()
Определения
installs.php:57
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\getPages
getPages()
Определения
installs.php:53
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\FACEBOOK_INSTALLS_CACHE_ID
const FACEBOOK_INSTALLS_CACHE_ID
Определения
installs.php:14
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\getPixel
getPixel()
Определения
installs.php:49
Bitrix\Seo\BusinessSuite\Configuration\Facebook\Installs\clearCache
static clearCache()
Определения
installs.php:74
Bitrix\Seo\BusinessSuite\ServiceAdapter\loadFacebookService
static loadFacebookService()
Определения
serviceadapter.php:53
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Seo\BusinessSuite\AuthAdapter\IAuthSettings
Определения
iauthsettings.php:6
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$response
$response
Определения
result.php:21
bitrix
modules
seo
lib
businesssuite
configuration
facebook
installs.php
Создано системой
1.14.0