本文整理汇总了PHP中Magento\Framework\Module\Manager::isDbSchemaUpToDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::isDbSchemaUpToDate方法的具体用法?PHP Manager::isDbSchemaUpToDate怎么用?PHP Manager::isDbSchemaUpToDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Module\Manager
的用法示例。
在下文中一共展示了Manager::isDbSchemaUpToDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isDbUpToDate
/**
* 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;
}
示例2: updateScheme
/**
* Apply database scheme updates whenever needed
*
* @return void
*/
public function updateScheme()
{
\Magento\Framework\Profiler::start('apply_db_schema_updates');
$this->_appState->setUpdateMode(true);
$afterApplyUpdates = array();
foreach (array_keys($this->_moduleList->getModules()) as $moduleName) {
foreach ($this->_resourceResolver->getResourceList($moduleName) as $resourceName) {
if (!$this->_moduleManager->isDbSchemaUpToDate($moduleName, $resourceName)) {
$setup = $this->_setupFactory->create($resourceName, $moduleName);
$setup->applyUpdates();
if ($setup->getCallAfterApplyAllUpdates()) {
$afterApplyUpdates[] = $setup;
}
}
}
}
/** @var $setup \Magento\Framework\Module\Updater\SetupInterface*/
foreach ($afterApplyUpdates as $setup) {
$setup->afterApplyAllUpdates();
}
$this->_appState->setUpdateMode(false);
$this->_isUpdatedSchema = true;
\Magento\Framework\Profiler::stop('apply_db_schema_updates');
}