改进异常类

This commit is contained in:
thinkphp
2016-06-12 17:08:48 +08:00
parent af1bc0429d
commit b1c8665b99
5 changed files with 10 additions and 9 deletions

View File

@@ -18,9 +18,10 @@ use think\Config;
use think\Db;
use think\db\Builder;
use think\db\Connection;
use think\db\DbException;
use think\Exception;
use think\exception\DbException;
use think\exception\PDOException;
use think\db\exception\BindParamException;
use think\db\exception\ModelNotFoundException;
use think\db\exception\DataNotFoundException;
use think\Loader;
@@ -179,7 +180,7 @@ class Query
* @param boolean $master 是否在主服务器读操作
* @param bool|string $class 指定返回的数据集对象
* @return mixed
* @throws DbBindParamException
* @throws BindParamException
* @throws PDOException
*/
public function query($sql, $bind = [], $fetch = false, $master = false, $class = false)
@@ -196,7 +197,7 @@ class Query
* @param boolean $getLastInsID 是否获取自增ID
* @param boolean $sequence 自增序列名
* @return int
* @throws DbBindParamException
* @throws BindParamException
* @throws PDOException
*/
public function execute($sql, $bind = [], $fetch = false, $getLastInsID = false, $sequence = null)

View File

@@ -11,16 +11,16 @@
namespace think\db\exception;
use think\db\Exception;
use think\exception\DbException;
/**
* PDO参数绑定异常
*/
class BindParamException extends Exception
class BindParamException extends DbException
{
/**
* DbBindParamException constructor.
* BindParamException constructor.
* @param string $message
* @param array $config
* @param string $sql

View File

@@ -11,7 +11,7 @@
namespace think\db\exception;
use think\db\DbException;
use think\exception\DbException;
class DataNotFoundException extends DbException
{

View File

@@ -11,7 +11,7 @@
namespace think\db\exception;
use think\db\DbException;
use think\exception\DbException;
class ModelNotFoundException extends DbException
{

View File

@@ -9,7 +9,7 @@
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://zjzit.cn>
// +----------------------------------------------------------------------
namespace think\db;
namespace think\exception;
use think\Exception;