@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function __construct() |
39 | 39 | { |
40 | 40 | $this->table = $this->getTableName(); |
41 | - $this->primary = (array)$this->getPrimaryKey(); |
|
41 | + $this->primary = ( array ) $this->getPrimaryKey(); |
|
42 | 42 | $this->orderField = $this->getOrderField(); |
43 | 43 | } |
44 | 44 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @return array|bool |
66 | 66 | * @throws QueryException |
67 | 67 | */ |
68 | - public function getRowById( $id, array $fields = [] ) |
|
68 | + public function getRowById( $id, array $fields = [ ] ) |
|
69 | 69 | { |
70 | 70 | $conditions = $this->getPrimaryKeyConditions( $id ); |
71 | 71 | $result = QueryBuild::select( $this->table )->fields( $fields ); |
@@ -130,14 +130,14 @@ discard block |
||
130 | 130 | throw new QueryException( 'Order field is not defined' ); |
131 | 131 | |
132 | 132 | $query = /** @lang text */ |
133 | - "UPDATE `{$this->table}` SET `{$this->orderField}` = CASE `{$this->primary[0]}` \r\n"; |
|
133 | + "UPDATE `{$this->table}` SET `{$this->orderField}` = CASE `{$this->primary[ 0 ]}` \r\n"; |
|
134 | 134 | foreach ( $updates_ord as $position => $id ) { |
135 | 135 | $pos = $position + 1; |
136 | 136 | $query .= " WHEN '$id' THEN '$pos' \r\n"; |
137 | 137 | } |
138 | 138 | $query .= "ELSE `{$this->orderField}` END"; |
139 | 139 | |
140 | - return PdoWrapperService::getInstance()->query($query, []); |
|
140 | + return PdoWrapperService::getInstance()->query( $query, [ ] ); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | if ( count( $this->primary ) !== count( $id ) ) |
155 | 155 | throw new QueryException( 'Invalid primary key', QueryException::QUERY_CRUD_INVALID_PRIMARY ); |
156 | 156 | |
157 | - $conditions = []; |
|
157 | + $conditions = [ ]; |
|
158 | 158 | |
159 | 159 | foreach ( $this->primary as $index => $key ) |
160 | 160 | $conditions[ $key ] = $id[ $index ]; |