Exemple #1
0
 /**
  * Apply database data updates whenever needed
  *
  * @return void
  */
 public function updateData()
 {
     foreach (array_keys($this->_moduleList->getModules()) as $moduleName) {
         foreach ($this->_resourceResolver->getResourceList($moduleName) as $resourceName) {
             if (!$this->_moduleManager->isDbDataUpToDate($moduleName, $resourceName)) {
                 $this->_setupFactory->create($resourceName, $moduleName)->applyDataUpdates();
             }
         }
     }
 }
 /**
  * Check if DB is up to date
  *
  * @return bool
  */
 private function isDbUpToDate()
 {
     foreach (array_keys($this->moduleList->getModules()) as $moduleName) {
         foreach ($this->resourceResolver->getResourceList($moduleName) as $resourceName) {
             $isSchemaUpToDate = $this->moduleManager->isDbSchemaUpToDate($moduleName, $resourceName);
             $isDataUpToDate = $this->moduleManager->isDbDataUpToDate($moduleName, $resourceName);
             if (!$isSchemaUpToDate || !$isDataUpToDate) {
                 return false;
             }
         }
     }
     return true;
 }