think\console\command\optimize\Schema::buildDataBaseSchema PHP Метод

buildDataBaseSchema() защищенный Метод

protected buildDataBaseSchema ( $tables, $db )
    protected function buildDataBaseSchema($tables, $db)
    {
        if ('' == $db) {
            $dbName = Db::getConfig('database') . '.';
        } else {
            $dbName = $db;
        }
        foreach ($tables as $table) {
            $content = '<?php ' . PHP_EOL . 'return ';
            $info = Db::getFields($db . $table);
            $content .= var_export($info, true) . ';';
            file_put_contents(RUNTIME_PATH . 'schema' . DS . $dbName . $table . EXT, $content);
        }
    }