_installDate = $deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE); $this->_storeManager = $storeManager; } /** * Retrieve stores configured in system. * * @return \Magento\Framework\Data\Collection\AbstractDb */ public function getStores() { if (!$this->_stores) { $this->_stores = $this->_storeManager->getStore()->getResourceCollection()->load(); } return $this->_stores; } /** * Retrieve number of loaded stores * * @return int */ public function countStores() { return sizeof($this->_stores->getItems()); } /** * Prepare array with periods for dashboard graphs * * @return array */ public function getDatePeriods() { return [ '24h' => __('Last 24 Hours'), '7d' => __('Last 7 Days'), '1m' => __('Current Month'), '1y' => __('YTD'), '2y' => __('2YTD') ]; } /** * Create data hash to ensure that we got valid * data and it is not changed by some one else. * * @param string $data * @return string */ public function getChartDataHash($data) { $secret = $this->_installDate; return md5($data . $secret); } }