@@ -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 | } |
@@ -25,8 +25,9 @@ discard block |
||
| 25 | 25 | public function select(string $fields = "*", array $paramns = []):self |
| 26 | 26 | {
|
| 27 | 27 | $query = "SELECT {$fields} FROM {$this->getTable()} ";
|
| 28 | - if (!empty($this->getTableAlias())) |
|
| 29 | - $query .= "AS {$this->getTableAlias()}";
|
|
| 28 | + if (!empty($this->getTableAlias())) {
|
|
| 29 | + $query .= "AS {$this->getTableAlias()}";
|
|
| 30 | + } |
|
| 30 | 31 | $this->add($query, $paramns); |
| 31 | 32 | return $this; |
| 32 | 33 | } |
@@ -175,8 +176,9 @@ discard block |
||
| 175 | 176 | |
| 176 | 177 | private function add(string $text, array $params = []) |
| 177 | 178 | {
|
| 178 | - if (!empty($params)) |
|
| 179 | - $this->params[] = $params; |
|
| 179 | + if (!empty($params)) {
|
|
| 180 | + $this->params[] = $params; |
|
| 181 | + } |
|
| 180 | 182 | $this->query .= $text; |
| 181 | 183 | } |
| 182 | 184 | |