src/MVC/Module.php
function getModel($params = '', &$config = array())
    {
        static $cache = array();
        if (!isset($cache[$params])) {
            $config = $this->parseModelParams($params);
            $model = DBFactory::make($config['model_type'], $config['model_config'], array($this->getConfig()));
            $cache[$params] = array('config' => $config, 'model' => $model);
        } else {
            $model = $cache[$params]['model'];
            $config = $cache[$params]['config'];
        }

        return $model;
    }
function getModel($params = '', &$config = array())
    {
        static $cache = array();
        if (!isset($cache[$params])) {
            $config = $this->parseModelParams($params);
            $model = DBFactory::make($config['model_type'], $config['model_config'], array($this->getConfig()));
            $cache[$params] = array('config' => $config, 'model' => $model);
        } else {
            $model = $cache[$params]['model'];
            $config = $cache[$params]['config'];
        }

        return $model;
    }
创建model实例,参数格式和构造函数一致

@param string $params
@param array $config
@return RedisDriver|CouchDriver|MongoDriver|PDOSqlDriver|mixed
@throws CoreException