@@ -14,7 +14,14 @@ |
||
| 14 | 14 | |
| 15 | 15 | interface UpdateInterface extends StatementInterface{ |
| 16 | 16 | |
| 17 | + /** |
|
| 18 | + * @return void |
|
| 19 | + */ |
|
| 17 | 20 | public function table(); |
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * @return void |
|
| 24 | + */ |
|
| 18 | 25 | public function set(); |
| 19 | 26 | public function where($val1, $val2, $operator = '=', $bind = true, $join = 'AND'):UpdateInterface; |
| 20 | 27 | public function openBracket($join = null):UpdateInterface; |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | $insert |
| 126 | 126 | ->into(self::TEST_TABLENAME) |
| 127 | 127 | ->values([ |
| 128 | - ['id' => 1, 'hash' => md5(1), 'data' => 'foo', 'value' => 123.456, 'active' => 0], |
|
| 128 | + ['id' => 1, 'hash' => md5(1), 'data' => 'foo', 'value' => 123.456, 'active' => 0], |
|
| 129 | 129 | ['id' => 2, 'hash' => md5(2), 'data' => 'foo', 'value' => 123.456789, 'active' => 1], |
| 130 | - ['id' => 3, 'hash' => md5(3), 'data' => 'foo', 'value' => 123.456, 'active' => 0], |
|
| 130 | + ['id' => 3, 'hash' => md5(3), 'data' => 'foo', 'value' => 123.456, 'active' => 0], |
|
| 131 | 131 | ]) |
| 132 | 132 | ; |
| 133 | 133 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $select = $this->statement->select; |
| 176 | 176 | $select |
| 177 | 177 | ->from([self::TEST_TABLENAME]) |
| 178 | - ->where('id', [1,2,3], 'in') |
|
| 178 | + ->where('id', [1, 2, 3], 'in') |
|
| 179 | 179 | ->orderby(['hash' => ['desc', 'lower']]); |
| 180 | 180 | # print_r(PHP_EOL.$select->sql().PHP_EOL); |
| 181 | 181 | $result = $select->execute(); |
@@ -43,8 +43,8 @@ |
||
| 43 | 43 | $sql = 'SELECT '; |
| 44 | 44 | $sql .= $this->limit ? 'FIRST ? SKIP ? ' : ''; |
| 45 | 45 | $sql .= $this->distinct ? 'DISTINCT ' : ''; |
| 46 | - $sql .= !empty($this->cols) ? implode($glue , $this->cols).PHP_EOL : '* '; |
|
| 47 | - $sql .= 'FROM '.implode($glue , $this->from); |
|
| 46 | + $sql .= !empty($this->cols) ? implode($glue, $this->cols).PHP_EOL : '* '; |
|
| 47 | + $sql .= 'FROM '.implode($glue, $this->from); |
|
| 48 | 48 | $sql .= $this->_getWhere(); |
| 49 | 49 | $sql .= !empty($this->groupby) ? PHP_EOL.'GROUP BY '.implode($glue, $this->groupby) : ''; |
| 50 | 50 | $sql .= !empty($this->orderby) ? PHP_EOL.'ORDER BY '.implode($glue, $this->orderby) : ''; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | if(is_string($k)){ |
| 84 | 84 | is_array($ref) |
| 85 | 85 | ? $this->addColumn($ref[0], $k, $ref[1] ?? null) |
| 86 | - : $this->addColumn($ref ,$k); |
|
| 86 | + : $this->addColumn($ref, $k); |
|
| 87 | 87 | } |
| 88 | 88 | else{ |
| 89 | 89 | is_array($ref) |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $from = $this->quote($table); |
| 106 | 106 | |
| 107 | 107 | if($ref){ |
| 108 | - $from = sprintf('%s AS %s', $this->quote($ref), $this->quote($table));// @todo: index hint |
|
| 108 | + $from = sprintf('%s AS %s', $this->quote($ref), $this->quote($table)); // @todo: index hint |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $this->from[$ref ?? $table] = $from; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $dir = strtoupper($expression[0]); |
| 177 | 177 | |
| 178 | 178 | if(in_array($dir, ['ASC', 'DESC'])){ |
| 179 | - $this->orderby[] = isset($expression[1]) ? strtoupper($expression[1]).'('.$this->quote($alias).') '.$dir : $dir; |
|
| 179 | + $this->orderby[] = isset($expression[1]) ? strtoupper($expression[1]).'('.$this->quote($alias).') '.$dir : $dir; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $dir = strtoupper($expression); |
| 185 | 185 | |
| 186 | 186 | if(in_array($dir, ['ASC', 'DESC'])){ |
| 187 | - $this->orderby[] = $this->quote($alias).' '.$dir; |
|
| 187 | + $this->orderby[] = $this->quote($alias).' '.$dir; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | } |