完善数据库类

This commit is contained in:
thinkphp
2016-04-16 15:51:16 +08:00
parent c62bc8bca2
commit 6fa007dc77
3 changed files with 89 additions and 50 deletions

View File

@@ -63,6 +63,7 @@ abstract class Connection
'password' => '',
// 端口
'hostport' => '',
// 连接dsn
'dsn' => '',
// 数据库连接参数
'params' => [],
@@ -80,8 +81,6 @@ abstract class Connection
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// like字段自动替换为%%包裹
'like_fields' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
];
@@ -123,6 +122,18 @@ abstract class Connection
return call_user_func_array([$this->query, $method], $args);
}
/**
* 设置当前name
* @access public
* @param string $name
* @return $this
*/
public function name($name)
{
$this->name = $name;
return $this;
}
/**
* 指定当前数据表
* @param string $table 数据表名称
@@ -150,18 +161,6 @@ abstract class Connection
return $tableName;
}
/**
* 设置当前name
* @access public
* @param string $name
* @return $this
*/
public function name($name)
{
$this->name = $name;
return $this;
}
/**
* 获取数据库的配置参数
* @access public