Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Config Class Reference
Inheritance diagram for Config:
DataObject

Public Member Functions

 __construct (\Magento\Framework\Module\Dir\Reader $moduleReader, \Magento\Store\Model\StoreManagerInterface $storeManager, array $data=[])
 
 getGlobalConfig ()
 
 getLanguage ()
 
 getDashboard ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 

Protected Attributes

 $_moduleReader
 
 $_storeManager
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Configuration for reports @api

Since
100.0.2

Definition at line 15 of file Config.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\Module\Dir\Reader  $moduleReader,
\Magento\Store\Model\StoreManagerInterface  $storeManager,
array  $data = [] 
)
Parameters
\Magento\Framework\Module\Dir\Reader$moduleReader
\Magento\Store\Model\StoreManagerInterface$storeManager
array$data

Definition at line 32 of file Config.php.

36  {
37  parent::__construct($data);
38  $this->_moduleReader = $moduleReader;
39  $this->_storeManager = $storeManager;
40  }
$storeManager

Member Function Documentation

◆ getDashboard()

getDashboard ( )

Return reports dashboard

Returns
string

Definition at line 77 of file Config.php.

78  {
79  return file_get_contents(
80  $this->_moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Reports') . '/flexDashboard.xml'
81  );
82  }

◆ getGlobalConfig()

getGlobalConfig ( )

Return reports global configuration

Returns
string

Definition at line 47 of file Config.php.

48  {
49  $dom = new \DOMDocument();
50  $dom->load($this->_moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Reports') . '/flexConfig.xml');
51 
52  $baseUrl = $dom->createElement('baseUrl');
53  $baseUrl->nodeValue = $this->_storeManager->getBaseUrl();
54 
55  $dom->documentElement->appendChild($baseUrl);
56 
57  return $dom->saveXML();
58  }

◆ getLanguage()

getLanguage ( )

Return reports language

Returns
string

Definition at line 65 of file Config.php.

66  {
67  return file_get_contents(
68  $this->_moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Reports') . '/flexLanguage.xml'
69  );
70  }

Field Documentation

◆ $_moduleReader

$_moduleReader
protected

Definition at line 20 of file Config.php.

◆ $_storeManager

$_storeManager
protected

Definition at line 25 of file Config.php.


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