@@ -69,8 +69,9 @@ discard block |
||
| 69 | 69 | { |
| 70 | 70 | $conditions = $this->getPrimaryKeyConditions( $id ); |
| 71 | 71 | $result = QueryBuild::select( $this->table )->fields( $fields ); |
| 72 | - foreach ( $conditions as $field => $value ) |
|
| 73 | - $result->whereEqual( $field, $value ); |
|
| 72 | + foreach ( $conditions as $field => $value ) { |
|
| 73 | + $result->whereEqual( $field, $value ); |
|
| 74 | + } |
|
| 74 | 75 | |
| 75 | 76 | return $result->first()->execute(); |
| 76 | 77 | } |
@@ -85,8 +86,9 @@ discard block |
||
| 85 | 86 | { |
| 86 | 87 | $conditions = $this->getPrimaryKeyConditions( $id ); |
| 87 | 88 | $result = QueryBuild::delete( $this->table ); |
| 88 | - foreach ( $conditions as $field => $value ) |
|
| 89 | - $result->whereEqual( $field, $value ); |
|
| 89 | + foreach ( $conditions as $field => $value ) { |
|
| 90 | + $result->whereEqual( $field, $value ); |
|
| 91 | + } |
|
| 90 | 92 | |
| 91 | 93 | return $result->execute(); |
| 92 | 94 | } |
@@ -101,8 +103,9 @@ discard block |
||
| 101 | 103 | { |
| 102 | 104 | $conditions = $this->getPrimaryKeyConditions( $id ); |
| 103 | 105 | $result = QueryBuild::update( $this->table ); |
| 104 | - foreach ( $conditions as $field => $value ) |
|
| 105 | - $result->whereEqual( $field, $value ); |
|
| 106 | + foreach ( $conditions as $field => $value ) { |
|
| 107 | + $result->whereEqual( $field, $value ); |
|
| 108 | + } |
|
| 106 | 109 | $result->setFieldsByArray( $arrayUpdater ); |
| 107 | 110 | |
| 108 | 111 | return $result->execute(); |
@@ -126,8 +129,9 @@ discard block |
||
| 126 | 129 | */ |
| 127 | 130 | public function saveOrder( $updates_ord = array() ) |
| 128 | 131 | { |
| 129 | - if ( empty( $this->orderField ) ) |
|
| 130 | - throw new QueryException( 'Order field is not defined' ); |
|
| 132 | + if ( empty( $this->orderField ) ) { |
|
| 133 | + throw new QueryException( 'Order field is not defined' ); |
|
| 134 | + } |
|
| 131 | 135 | |
| 132 | 136 | $query = /** @lang text */ |
| 133 | 137 | "UPDATE `{$this->table}` SET `{$this->orderField}` = CASE `{$this->primary[0]}` \r\n"; |
@@ -151,13 +155,15 @@ discard block |
||
| 151 | 155 | |
| 152 | 156 | $id = (array)$id; |
| 153 | 157 | |
| 154 | - if ( count( $this->primary ) !== count( $id ) ) |
|
| 155 | - throw new QueryException( 'Invalid primary key', QueryException::QUERY_CRUD_INVALID_PRIMARY ); |
|
| 158 | + if ( count( $this->primary ) !== count( $id ) ) { |
|
| 159 | + throw new QueryException( 'Invalid primary key', QueryException::QUERY_CRUD_INVALID_PRIMARY ); |
|
| 160 | + } |
|
| 156 | 161 | |
| 157 | 162 | $conditions = []; |
| 158 | 163 | |
| 159 | - foreach ( $this->primary as $index => $key ) |
|
| 160 | - $conditions[ $key ] = $id[ $index ]; |
|
| 164 | + foreach ( $this->primary as $index => $key ) { |
|
| 165 | + $conditions[ $key ] = $id[ $index ]; |
|
| 166 | + } |
|
| 161 | 167 | |
| 162 | 168 | return $conditions; |
| 163 | 169 | } |