Skip to content

Commit

Permalink
query builder: remove never finished concept for other than select qu…
Browse files Browse the repository at this point in the history
…eries
  • Loading branch information
hrach committed May 28, 2020
1 parent 5daf8f6 commit 571c47c
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/QueryBuilder/QueryBuilder.php
Expand Up @@ -15,18 +15,9 @@ class QueryBuilder
use StrictObjectTrait;


/** @const */
const TYPE_SELECT = 1;
const TYPE_INSERT = 2;
const TYPE_UPDATE = 3;
const TYPE_DELETE = 4;

/** @var IDriver */
private $driver;

/** @var int */
private $type = self::TYPE_SELECT;

/**
* @var array
* @phpstan-var array<string, array<mixed>|null>
Expand Down Expand Up @@ -94,15 +85,8 @@ public function getQuerySql(): string
return $this->generatedSql;
}

switch ($this->type) {
case self::TYPE_SELECT:
default:
$sql = $this->getSqlForSelect();
break;
}

$this->generatedSql = $sql;
return $sql;
$this->generatedSql = $this->getSqlForSelect();
return $this->generatedSql;
}


Expand Down Expand Up @@ -177,7 +161,6 @@ public function getClause(string $part): array
public function from(string $fromExpression, ?string $alias = null, ...$args): self
{
$this->dirty();
$this->type = self::TYPE_SELECT;
$this->from = [$fromExpression, $alias];
$this->pushArgs('from', $args);
return $this;
Expand Down

0 comments on commit 571c47c

Please sign in to comment.