suppression de l'objet db dans l'objet QueryBuilder
This commit is contained in:
@@ -3,8 +3,7 @@
|
|||||||
namespace Kletellier\PdoWrapper;
|
namespace Kletellier\PdoWrapper;
|
||||||
|
|
||||||
class QueryBuilder
|
class QueryBuilder
|
||||||
{
|
{
|
||||||
protected ?Connection $db;
|
|
||||||
protected array $columns;
|
protected array $columns;
|
||||||
protected array $wheres;
|
protected array $wheres;
|
||||||
protected array $orders;
|
protected array $orders;
|
||||||
@@ -21,8 +20,7 @@ class QueryBuilder
|
|||||||
{
|
{
|
||||||
$this->table = $table;
|
$this->table = $table;
|
||||||
$this->pk = $pk;
|
$this->pk = $pk;
|
||||||
$this->connection = $connection;
|
$this->connection = $connection;
|
||||||
$this->db = null;
|
|
||||||
$this->reset();
|
$this->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,9 +194,8 @@ class QueryBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function getData(): mixed
|
private function getData(): mixed
|
||||||
{
|
{
|
||||||
$this->db = Connection::getInstance($this->connection);
|
return Connection::getInstance($this->connection)->getSelectQuery($this->getQuery());
|
||||||
return $this->db->getSelectQuery($this->getQuery());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getConstructedQuery(): Query
|
private function getConstructedQuery(): Query
|
||||||
|
|||||||
Reference in New Issue
Block a user