@@ -161,8 +161,9 @@ |
||
| 161 | 161 | */ |
| 162 | 162 | protected function setTableName(string $tableName, string $tableAlias = ""): self |
| 163 | 163 | { |
| 164 | - if (!empty($tableAlias)) |
|
| 165 | - $this->tableAlias = $tableAlias; |
|
| 164 | + if (!empty($tableAlias)) {
|
|
| 165 | + $this->tableAlias = $tableAlias; |
|
| 166 | + } |
|
| 166 | 167 | $this->tableName = $tableName; |
| 167 | 168 | return $this; |
| 168 | 169 | } |
@@ -33,8 +33,9 @@ |
||
| 33 | 33 | |
| 34 | 34 | $sql = "SELECT {$fields} FROM {$this->getTableName()}";
|
| 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 | |
@@ -47,8 +47,9 @@ discard block |
||
| 47 | 47 | {
|
| 48 | 48 | try {
|
| 49 | 49 | $query = "SELECT {$fields} FROM {$this->getTableName()}";
|
| 50 | - if (!empty($this->getTableAlias())) |
|
| 51 | - $query .= " AS {$this->getTableAlias()}";
|
|
| 50 | + if (!empty($this->getTableAlias())) {
|
|
| 51 | + $query .= " AS {$this->getTableAlias()}";
|
|
| 52 | + } |
|
| 52 | 53 | $this->add($query, "main", $paramns); |
| 53 | 54 | return $this; |
| 54 | 55 | } catch (\PDOException $e) {
|
@@ -402,8 +403,9 @@ discard block |
||
| 402 | 403 | $this->sqlPartsSelect[$type] = $query; |
| 403 | 404 | } |
| 404 | 405 | |
| 405 | - if (!empty($params)) |
|
| 406 | - $this->setParams($params); |
|
| 406 | + if (!empty($params)) {
|
|
| 407 | + $this->setParams($params); |
|
| 408 | + } |
|
| 407 | 409 | } catch (\PDOException $e) {
|
| 408 | 410 | $this->setError($e); |
| 409 | 411 | } |
@@ -106,8 +106,9 @@ |
||
| 106 | 106 | if (is_array($data) || is_object($data)) { |
| 107 | 107 | $result = []; |
| 108 | 108 | foreach ($data as $key => $value) { |
| 109 | - if(strlen($value) > 0) |
|
| 110 | - $result[$key] = (is_array($value) || is_object($value)) ? $this->toMap($value) : $value; |
|
| 109 | + if(strlen($value) > 0) {
|
|
| 110 | + $result[$key] = (is_array($value) || is_object($value)) ? $this->toMap($value) : $value; |
|
| 111 | + } |
|
| 111 | 112 | } |
| 112 | 113 | |
| 113 | 114 | return $result; |