@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function join($table, $filter) |
97 | 97 | { |
98 | - $this->join[] = [ 'table'=>$table, 'filter'=>$filter, 'type' => 'INNER']; |
|
98 | + $this->join[] = ['table'=>$table, 'filter'=>$filter, 'type' => 'INNER']; |
|
99 | 99 | return $this; |
100 | 100 | } |
101 | 101 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function leftJoin($table, $filter) |
111 | 111 | { |
112 | - $this->join[] = [ 'table'=>$table, 'filter'=>$filter, 'type' => 'LEFT']; |
|
112 | + $this->join[] = ['table'=>$table, 'filter'=>$filter, 'type' => 'LEFT']; |
|
113 | 113 | return $this; |
114 | 114 | } |
115 | 115 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function where($filter, array $params = []) |
125 | 125 | { |
126 | - $this->where[] = [ 'filter' => $filter, 'params' => $params ]; |
|
126 | + $this->where[] = ['filter' => $filter, 'params' => $params]; |
|
127 | 127 | return $this; |
128 | 128 | } |
129 | 129 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | return null; |
214 | 214 | } |
215 | 215 | |
216 | - return [ implode(' AND ', $where), $params ]; |
|
216 | + return [implode(' AND ', $where), $params]; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -264,6 +264,6 @@ discard block |
||
264 | 264 | |
265 | 265 | $sql = ORMHelper::processLiteral($sql, $params); |
266 | 266 | |
267 | - return [ 'sql' => $sql, 'params' => $params ]; |
|
267 | + return ['sql' => $sql, 'params' => $params]; |
|
268 | 268 | } |
269 | 269 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function fields(array $fields) |
33 | 33 | { |
34 | - $this->fields = array_merge($this->fields, (array)$fields); |
|
34 | + $this->fields = array_merge($this->fields, (array) $fields); |
|
35 | 35 | |
36 | 36 | return $this; |
37 | 37 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function where($filter, array $params = []) |
62 | 62 | { |
63 | - $this->where[] = [ 'filter' => $filter, 'params' => $params ]; |
|
63 | + $this->where[] = ['filter' => $filter, 'params' => $params]; |
|
64 | 64 | return $this; |
65 | 65 | } |
66 | 66 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | return null; |
88 | 88 | } |
89 | 89 | |
90 | - return [ implode(' AND ', $where), $params ]; |
|
90 | + return [implode(' AND ', $where), $params]; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $instance = $item->getEntity(); |
136 | 136 | $data = $row->toArray(); |
137 | 137 | |
138 | - foreach ((array)$item->getFieldAlias() as $fieldname => $fieldalias) { |
|
138 | + foreach ((array) $item->getFieldAlias() as $fieldname => $fieldalias) { |
|
139 | 139 | if (isset($data[$fieldalias])) { |
140 | 140 | $data[$fieldname] = $data[$fieldalias]; |
141 | 141 | unset($fieldalias); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | BinderObject::bindObject($data, $instance); |
145 | 145 | |
146 | - foreach ((array)$item->getFieldMap() as $property => $fieldmap) { |
|
146 | + foreach ((array) $item->getFieldMap() as $property => $fieldmap) { |
|
147 | 147 | $selectMask = $fieldmap[Mapper::FIELDMAP_SELECTMASK]; |
148 | 148 | $value = isset($data[$fieldmap[Mapper::FIELDMAP_FIELD]]) ? $data[$fieldmap[Mapper::FIELDMAP_FIELD]] : ""; |
149 | 149 | $data[$property] = $selectMask($value, $instance); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $array = BinderObject::toArrayFrom($instance, true); |
169 | 169 | |
170 | 170 | // Mapping the data |
171 | - foreach ((array)$this->getMapper()->getFieldMap() as $property => $fieldmap) { |
|
171 | + foreach ((array) $this->getMapper()->getFieldMap() as $property => $fieldmap) { |
|
172 | 172 | $fieldname = $fieldmap[Mapper::FIELDMAP_FIELD]; |
173 | 173 | $updateMask = $fieldmap[Mapper::FIELDMAP_UPDATEMASK]; |
174 | 174 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | ->fields(array_keys($array)); |
191 | 191 | |
192 | 192 | // Check if is insert or update |
193 | - if (empty($array[$this->mapper->getPrimaryKey()]) || count($this->get($array[$this->mapper->getPrimaryKey()])) === 0) { |
|
193 | + if (empty($array[$this->mapper->getPrimaryKey()]) || count($this->get($array[$this->mapper->getPrimaryKey()])) === 0) { |
|
194 | 194 | $array[$this->mapper->getPrimaryKey()] = $this->insert($updatable, $array); |
195 | 195 | BinderObject::bindObject($array, $instance); |
196 | 196 | } else { |