@@ -190,12 +190,12 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | protected function cleanAttributesOverride($attributes) |
| 192 | 192 | { |
| 193 | - if (sizeof($this->override) > 0 && sizeof($attributes) >0) { |
|
| 193 | + if (sizeof($this->override) > 0 && sizeof($attributes) > 0) { |
|
| 194 | 194 | foreach ($this->override as $field => $queryParams) { |
| 195 | 195 | $newOverrideValues = $this->getNewOverrideValues($attributes[$field], $queryParams); |
| 196 | 196 | $saveField = \yii\helpers\ArrayHelper::getValue($queryParams, 'saveField', $field); |
| 197 | 197 | |
| 198 | - if (count($newOverrideValues) >1) { |
|
| 198 | + if (count($newOverrideValues) > 1) { |
|
| 199 | 199 | $attributes[$saveField] = implode(', ', |
| 200 | 200 | \yii\helpers\ArrayHelper::map($newOverrideValues, $queryParams['returnField'], $queryParams['returnField']) |
| 201 | 201 | ); |
@@ -237,12 +237,12 @@ discard block |
||
| 237 | 237 | $oldAttributes = $this->cleanAttributes($this->getOldAttributes()); |
| 238 | 238 | |
| 239 | 239 | // ensure to handle serialized attributes properly |
| 240 | - foreach($newAttributes as $key => $value) |
|
| 241 | - if(is_array($newAttributes[$key])) |
|
| 240 | + foreach ($newAttributes as $key => $value) |
|
| 241 | + if (is_array($newAttributes[$key])) |
|
| 242 | 242 | $newAttributes[$key] = Json::encode($newAttributes[$key]); |
| 243 | 243 | |
| 244 | - foreach($oldAttributes as $key => $value) |
|
| 245 | - if(is_array($oldAttributes[$key])) |
|
| 244 | + foreach ($oldAttributes as $key => $value) |
|
| 245 | + if (is_array($oldAttributes[$key])) |
|
| 246 | 246 | $oldAttributes[$key] = Json::encode($oldAttributes[$key]); |
| 247 | 247 | |
| 248 | 248 | // If no difference then get out of here |
@@ -237,13 +237,15 @@ |
||
| 237 | 237 | $oldAttributes = $this->cleanAttributes($this->getOldAttributes()); |
| 238 | 238 | |
| 239 | 239 | // ensure to handle serialized attributes properly |
| 240 | - foreach($newAttributes as $key => $value) |
|
| 241 | - if(is_array($newAttributes[$key])) |
|
| 240 | + foreach($newAttributes as $key => $value) { |
|
| 241 | + if(is_array($newAttributes[$key])) |
|
| 242 | 242 | $newAttributes[$key] = Json::encode($newAttributes[$key]); |
| 243 | + } |
|
| 243 | 244 | |
| 244 | - foreach($oldAttributes as $key => $value) |
|
| 245 | - if(is_array($oldAttributes[$key])) |
|
| 245 | + foreach($oldAttributes as $key => $value) { |
|
| 246 | + if(is_array($oldAttributes[$key])) |
|
| 246 | 247 | $oldAttributes[$key] = Json::encode($oldAttributes[$key]); |
| 248 | + } |
|
| 247 | 249 | |
| 248 | 250 | // If no difference then get out of here |
| 249 | 251 | if (count(array_diff_assoc($newAttributes, $oldAttributes)) <= 0) { |