Skip to content

Commit

Permalink
query builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Morais authored and Bruno Morais committed Nov 18, 2023
1 parent 8ecc9db commit 1ce0038
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
9 changes: 1 addition & 8 deletions src/QueryBuilder.php → src/CrudBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@
* @access private
*/

class QueryBuilder
class CrudBuilder
{
use DatalayerTrait;

public function __construct(DatalayerTrait $data)
{
$this->setInstance($data->getInstance());
$this->setTable($data->getTable());
$this->setClassModel($this->getClassModel());
}

public function select(string $fields = "*", array $paramns = []):self
{
$query = "SELECT {$fields} FROM {$this->getTable()} ";
Expand Down
9 changes: 0 additions & 9 deletions src/DatalayerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ trait DatalayerTrait
/** @var array */
private $params = [];

private QueryBuilder $queryBuild;


/** @return PDO|false */
private function getInstance()
Expand Down Expand Up @@ -148,13 +146,6 @@ protected function getTable(): string
return $this->tableName;
}

public function getQueryBuilder(): QueryBuilder
{
if (!empty($this->queryBuild))
return $this->queryBuild;
return new QueryBuilder($this);
}

public function getTableAlias(): string
{
return $this->tableAlias;
Expand Down

0 comments on commit 1ce0038

Please sign in to comment.