yupe\components\Migrator::updateToLatest PHP Метод

updateToLatest() публичный Метод

Обновление до актуальной миграции:
public updateToLatest ( string $module ) : boolean
$module string - required module
Результат boolean if migration updated
    public function updateToLatest($module)
    {
        if (($newMigrations = $this->getNewMigrations($module)) !== []) {
            if (Yii::app()->hasComponent('cache')) {
                Yii::app()->getComponent('cache')->flush();
            }
            Yii::log(Yii::t('YupeModule.yupe', 'Updating DB of {module}  to latest version', ['{module}' => $module]));
            foreach ($newMigrations as $migration) {
                if ($this->migrateUp($module, $migration) === false) {
                    return false;
                }
            }
            if (Yii::app()->hasComponent('cache')) {
                Yii::app()->getComponent('cache')->flush();
            }
        } else {
            Yii::log(Yii::t('YupeModule.yupe', 'There is no new migrations for {module}', ['{module}' => $module]));
        }
        return true;
    }