_dateFilter = $dateFilter; $this->reportTypes = $reportTypes; parent::__construct($context); } /** * Add reports and statistics breadcrumbs * * @return $this */ public function _initAction() { $this->_view->loadLayout(); $this->_addBreadcrumb(__('Reports'), __('Reports')); $this->_addBreadcrumb(__('Statistics'), __('Statistics')); return $this; } /** * Retrieve array of collection names by code specified in request * * @return array * @throws \Exception */ protected function _getCollectionNames() { $codes = $this->getRequest()->getParam('code'); if (!$codes) { throw new \Exception(__('No report code is specified.')); } if (!is_array($codes) && strpos($codes, ',') === false) { $codes = [$codes]; } elseif (!is_array($codes)) { $codes = explode(',', $codes); } $out = []; foreach ($codes as $code) { $out[] = $this->reportTypes[$code]; } return $out; } /** * Retrieve admin session model * * @return AuthSession|Session|mixed|null */ protected function _getSession() { if ($this->_adminSession === null) { $this->_adminSession = $this->_objectManager->get(\Magento\Backend\Model\Auth\Session::class); } return $this->_adminSession; } }