@@ -33,8 +33,9 @@ |
||
| 33 | 33 | |
| 34 | 34 | $sql = "SELECT {$fields} FROM {$this->getTable()}";
|
| 35 | 35 | |
| 36 | - if (!empty($this->getTableAlias())) |
|
| 37 | - $sql .= " AS {$this->getTableAlias()}";
|
|
| 36 | + if (!empty($this->getTableAlias())) {
|
|
| 37 | + $sql .= " AS {$this->getTableAlias()}";
|
|
| 38 | + } |
|
| 38 | 39 | |
| 39 | 40 | $sql .= "{$add}";
|
| 40 | 41 | |
@@ -132,8 +132,9 @@ |
||
| 132 | 132 | */ |
| 133 | 133 | protected function setTable(string $tableName, string $tableAlias = ""): self |
| 134 | 134 | { |
| 135 | - if (!empty($tableAlias)) |
|
| 136 | - $this->tableAlias = $tableAlias; |
|
| 135 | + if (!empty($tableAlias)) {
|
|
| 136 | + $this->tableAlias = $tableAlias; |
|
| 137 | + } |
|
| 137 | 138 | $this->tableName = $tableName; |
| 138 | 139 | return $this; |
| 139 | 140 | } |
@@ -20,8 +20,9 @@ discard block |
||
| 20 | 20 | public function select(string $fields = "*", array $paramns = []):self |
| 21 | 21 | {
|
| 22 | 22 | $query = "SELECT {$fields} FROM {$this->getTable()} ";
|
| 23 | - if (!empty($this->getTableAlias())) |
|
| 24 | - $query .= "AS {$this->getTableAlias()} ";
|
|
| 23 | + if (!empty($this->getTableAlias())) {
|
|
| 24 | + $query .= "AS {$this->getTableAlias()} ";
|
|
| 25 | + } |
|
| 25 | 26 | $this->add($query, $paramns); |
| 26 | 27 | return $this; |
| 27 | 28 | } |
@@ -171,8 +172,9 @@ discard block |
||
| 171 | 172 | |
| 172 | 173 | private function add(string $text, array $params = []) |
| 173 | 174 | {
|
| 174 | - if (!empty($params)) |
|
| 175 | - $this->params = array_merge($this->params, $params); |
|
| 175 | + if (!empty($params)) {
|
|
| 176 | + $this->params = array_merge($this->params, $params); |
|
| 177 | + } |
|
| 176 | 178 | $this->query .= $text; |
| 177 | 179 | } |
| 178 | 180 | |