/** * Get data * * @return array */ public function getData() { if (isset($this->loadedData)) { return $this->loadedData; } $stores = $this->systemStore->getStoreOptionHash(); $stores[0] = __('All Store Views'); $items = $this->collection->getItems(); /** @var \Swissup\Core\Model\Module $module */ foreach ($items as $module) { $result['general'] = $module->getData(); $oldStores = implode("\n", array_intersect_key($stores, array_flip($module->getOldStores()))); if (!$oldStores) { $oldStores = __('None'); } $result['general']['store_labels'] = $oldStores; $this->loadedData[$module->getCode()] = $result; } return $this->loadedData; }
/** * Sort by locally available modules * * @return $this */ protected function _initSelect() { parent::_initSelect(); $this->getSelect()->order(new \Zend_Db_Expr('IF (ISNULL(main_table.version), 0, 1) DESC')); return $this; }