function D($name='') { if (C('DB_TYPE') == 'mongo') return new MongoModel($name); ...
$class = C('DB_TYPE') == 'mongo' ? 'MongoModel' : 'Model';