Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
AnalyticsToken Class Reference

Public Member Functions

 __construct (ReinitableConfigInterface $reinitableConfig, ScopeConfigInterface $config, WriterInterface $configWriter)
 
 getToken ()
 
 storeToken ($value)
 
 isTokenExist ()
 

Detailed Description

Model for handling Magento BI token value into config.

Definition at line 15 of file AnalyticsToken.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ReinitableConfigInterface  $reinitableConfig,
ScopeConfigInterface  $config,
WriterInterface  $configWriter 
)
Parameters
ReinitableConfigInterface$reinitableConfig
ScopeConfigInterface$config
WriterInterface$configWriter

Definition at line 48 of file AnalyticsToken.php.

52  {
53  $this->reinitableConfig = $reinitableConfig;
54  $this->config = $config;
55  $this->configWriter = $configWriter;
56  }

Member Function Documentation

◆ getToken()

getToken ( )

Get Magento BI token value.

Returns
string|null

Definition at line 63 of file AnalyticsToken.php.

64  {
65  return $this->config->getValue($this->tokenPath);
66  }

◆ isTokenExist()

isTokenExist ( )

Check Magento BI token value exist.

Returns
bool

Definition at line 88 of file AnalyticsToken.php.

89  {
90  return (bool)$this->getToken();
91  }

◆ storeToken()

storeToken (   $value)

Stores Magento BI token value.

Parameters
string$value
Returns
bool

Definition at line 75 of file AnalyticsToken.php.

76  {
77  $this->configWriter->save($this->tokenPath, $value);
78  $this->reinitableConfig->reinit();
79 
80  return true;
81  }
$value
Definition: gender.phtml:16

The documentation for this class was generated from the following file: