Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-backend
Helper
Dashboard
Data.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Backend\Helper\Dashboard
;
7
8
use
Magento\Framework\App\DeploymentConfig
;
9
use
Magento\Framework\Config\ConfigOptionsListConstants
;
10
17
class
Data
extends
\Magento\Framework\App\Helper\AbstractHelper
18
{
22
protected
$_stores
;
23
27
protected
$_installDate
;
28
32
private
$_storeManager;
33
39
public
function
__construct
(
40
\
Magento
\Framework\
App
\Helper\
Context
$context,
41
\
Magento
\Store\Model\StoreManagerInterface
$storeManager
,
42
DeploymentConfig
$deploymentConfig
43
) {
44
parent::__construct(
45
$context
46
);
47
$this->_installDate =
$deploymentConfig
->get(
ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE
);
48
$this->_storeManager =
$storeManager
;
49
}
50
56
public
function
getStores
()
57
{
58
if
(!$this->_stores) {
59
$this->_stores = $this->_storeManager->getStore()->getResourceCollection()->load();
60
}
61
return
$this->_stores
;
62
}
63
69
public
function
countStores
()
70
{
71
return
sizeof
($this->_stores->getItems());
72
}
73
79
public
function
getDatePeriods
()
80
{
81
return
[
82
'24h'
=>
__
(
'Last 24 Hours'
),
83
'7d'
=>
__
(
'Last 7 Days'
),
84
'1m'
=>
__
(
'Current Month'
),
85
'1y'
=>
__
(
'YTD'
),
86
'2y'
=>
__
(
'2YTD'
)
87
];
88
}
89
97
public
function
getChartDataHash
(
$data
)
98
{
99
$secret =
$this->_installDate
;
100
return
md5(
$data
. $secret);
101
}
102
}
Magento\Backend\Helper\Dashboard\Data\getDatePeriods
getDatePeriods()
Definition:
Data.php:79
Magento\Backend\Helper\Dashboard\Data\$_stores
$_stores
Definition:
Data.php:22
Magento\Backend\Helper\Dashboard
Definition:
AbstractDashboard.php:6
Magento\Framework\App
Magento\Framework\Config\ConfigOptionsListConstants\CONFIG_PATH_INSTALL_DATE
const CONFIG_PATH_INSTALL_DATE
Definition:
ConfigOptionsListConstants.php:21
Magento\Backend\Helper\Dashboard\Data\getChartDataHash
getChartDataHash($data)
Definition:
Data.php:97
Magento\Framework\App\DeploymentConfig
Definition:
DeploymentConfig.php:17
$storeManager
$storeManager
Definition:
paypal_quote.php:14
__
__()
Definition:
__.php:13
$deploymentConfig
$deploymentConfig
Definition:
health_check.php:18
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Backend\Helper\Dashboard\Data\countStores
countStores()
Definition:
Data.php:69
Magento\Framework\Config\ConfigOptionsListConstants
Definition:
ConfigOptionsListConstants.php:16
Magento\Backend\Helper\Dashboard\Data\$_installDate
$_installDate
Definition:
Data.php:27
Magento\Backend\Helper\Dashboard\Data
Definition:
Data.php:17
Magento
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Framework\App\Helper\AbstractHelper
Definition:
AbstractHelper.php:13
Magento\Backend\Helper\Dashboard\Data\__construct
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, DeploymentConfig $deploymentConfig)
Definition:
Data.php:39
Magento\Backend\Helper\Dashboard\Data\getStores
getStores()
Definition:
Data.php:56
Magento\Framework\App\DeploymentConfig
Definition:
CommentParser.php:6