Cleanup database logic a bit

这个提交包含在:
Timothy Warren 2019-01-07 14:29:15 -05:00
父节点 5d752f6ee3
当前提交 1c3b478d49
共有 2 个文件被更改,包括 9 次插入8 次删除

查看文件

@ -25,6 +25,12 @@ use PDOException;
*/
class Collection extends DB {
/**
* The query builder object
* @var \Query\Query_Builder_Interface
*/
protected $db;
/**
* Whether the database is valid for querying
* @var boolean
@ -43,6 +49,7 @@ class Collection extends DB {
try
{
$this->db = \Query($this->dbConfig);
$this->validDatabase = TRUE;
}
catch (PDOException $e) {}
@ -62,9 +69,9 @@ class Collection extends DB {
$this->validDatabase = FALSE;
}
}
else
else if ($this->db === NULL)
{
$this->validDatabase = TRUE;
$this->validDatabase = FALSE;
}
}

查看文件

@ -24,12 +24,6 @@ use Aviat\Ion\Di\{ContainerAware, ContainerInterface};
class DB {
use ContainerAware;
/**
* The query builder object
* @var \Query\Query_Builder_Interface
*/
protected $db;
/**
* The database connection information array
* @var array $dbConfig