@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | if (count($this->fillableColumns)) { |
| 40 | 40 | foreach ($sets as $key => $value) { |
| 41 | 41 | if ( ! in_array($key, $this->fillableColumns)) { |
| 42 | - unset($sets[ $key ]); |
|
| 42 | + unset($sets[$key]); |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | if (method_exists($this, 'getRecordOrdering')) { |
| 56 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
| 57 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering(); |
|
| 56 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
| 57 | + $sets['record_ordering'] = $this->getRecordOrdering(); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | if ($files = input()->files()) { |
| 70 | 70 | // Uploaded Image Process |
| 71 | 71 | if (isset($this->uploadedImageKey)) { |
| 72 | - if (isset($files[ $this->uploadedImageKey ])) { |
|
| 72 | + if (isset($files[$this->uploadedImageKey])) { |
|
| 73 | 73 | $upload->process($this->uploadedImageKey); |
| 74 | 74 | |
| 75 | 75 | if ($upload->getErrors()) { |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | } elseif (count($this->uploadedImageKeys)) { |
| 90 | 90 | foreach ($this->uploadedImageKeys as $uploadedImageKey) { |
| 91 | - if (isset($files[ $uploadedImageKey ])) { |
|
| 91 | + if (isset($files[$uploadedImageKey])) { |
|
| 92 | 92 | $upload->process($uploadedImageKey); |
| 93 | 93 | |
| 94 | 94 | if ($upload->getErrors()) { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | // Uploaded File Process |
| 112 | 112 | if (isset($this->uploadedFileFilepath)) { |
| 113 | - if (isset($files[ $this->uploadedFileKey ])) { |
|
| 113 | + if (isset($files[$this->uploadedFileKey])) { |
|
| 114 | 114 | $upload->process($this->uploadedFileKey); |
| 115 | 115 | |
| 116 | 116 | if ($upload->getErrors()) { |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | } elseif (count($this->uploadedFileKeys)) { |
| 131 | 131 | foreach ($this->uploadedFileKeys as $uploadedFileKey) { |
| 132 | - if (isset($files[ $uploadedFileKey ])) { |
|
| 132 | + if (isset($files[$uploadedFileKey])) { |
|
| 133 | 133 | $upload->process($uploadedFileKey); |
| 134 | 134 | |
| 135 | 135 | if ($upload->getErrors()) { |
@@ -162,8 +162,8 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | $label = false; |
| 164 | 164 | foreach (['name', 'label', 'title', 'code'] as $labelField) { |
| 165 | - if (isset($sets[ $labelField ])) { |
|
| 166 | - session()->setFlash('success', language('SUCCESS_INSERT_WITH_LABEL', $sets[ $labelField ])); |
|
| 165 | + if (isset($sets[$labelField])) { |
|
| 166 | + session()->setFlash('success', language('SUCCESS_INSERT_WITH_LABEL', $sets[$labelField])); |
|
| 167 | 167 | $label = true; |
| 168 | 168 | break; |
| 169 | 169 | } |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | $label = false; |
| 181 | 181 | foreach (['name', 'label', 'title', 'code'] as $labelField) { |
| 182 | - if (isset($sets[ $labelField ])) { |
|
| 183 | - session()->setFlash('danger', language('FAILED_INSERT_WITH_LABEL', $sets[ $labelField ])); |
|
| 182 | + if (isset($sets[$labelField])) { |
|
| 183 | + session()->setFlash('danger', language('FAILED_INSERT_WITH_LABEL', $sets[$labelField])); |
|
| 184 | 184 | $label = true; |
| 185 | 185 | break; |
| 186 | 186 | } |
@@ -213,8 +213,8 @@ discard block |
||
| 213 | 213 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
| 214 | 214 | |
| 215 | 215 | if (empty($conditions)) { |
| 216 | - if (isset($sets[ $primaryKey ])) { |
|
| 217 | - $conditions = [$primaryKey => $sets[ $primaryKey ]]; |
|
| 216 | + if (isset($sets[$primaryKey])) { |
|
| 217 | + $conditions = [$primaryKey => $sets[$primaryKey]]; |
|
| 218 | 218 | } else { |
| 219 | 219 | $conditions = $sets; |
| 220 | 220 | } |
@@ -248,8 +248,8 @@ discard block |
||
| 248 | 248 | if (method_exists($this, 'insertRecordSets')) { |
| 249 | 249 | foreach ($sets as $set) { |
| 250 | 250 | $this->insertRecordSets($set); |
| 251 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
| 252 | - $set[ 'record_ordering' ] = $this->getRecordOrdering(); |
|
| 251 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
| 252 | + $set['record_ordering'] = $this->getRecordOrdering(); |
|
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | } |
@@ -321,15 +321,15 @@ discard block |
||
| 321 | 321 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
| 322 | 322 | |
| 323 | 323 | if (empty($conditions)) { |
| 324 | - if (isset($sets[ $primaryKey ])) { |
|
| 325 | - $conditions = [$primaryKey => $sets[ $primaryKey ]]; |
|
| 324 | + if (isset($sets[$primaryKey])) { |
|
| 325 | + $conditions = [$primaryKey => $sets[$primaryKey]]; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | if (count($this->fillableColumns)) { |
| 330 | 330 | foreach ($sets as $key => $value) { |
| 331 | 331 | if ( ! in_array($key, $this->fillableColumns)) { |
| 332 | - unset($sets[ $key ]); |
|
| 332 | + unset($sets[$key]); |
|
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | 335 | } |
@@ -343,8 +343,8 @@ discard block |
||
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | if (method_exists($this, 'getRecordOrdering')) { |
| 346 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
| 347 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering(); |
|
| 346 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
| 347 | + $sets['record_ordering'] = $this->getRecordOrdering(); |
|
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | if ($files = input()->files()) { |
| 361 | 361 | // Uploaded Image Process |
| 362 | 362 | if (isset($this->uploadedImageKey)) { |
| 363 | - if (isset($files[ $this->uploadedImageKey ])) { |
|
| 363 | + if (isset($files[$this->uploadedImageKey])) { |
|
| 364 | 364 | $upload->process($this->uploadedImageKey); |
| 365 | 365 | |
| 366 | 366 | if ($upload->getErrors()) { |
@@ -375,8 +375,8 @@ discard block |
||
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | return false; |
| 378 | - } elseif ($row->offsetGet($this->uploadedImageKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) { |
|
| 379 | - $sets[ $this->uploadedImageKey ] = $upload->getUploadedFiles()->first()[ 'name' ]; |
|
| 378 | + } elseif ($row->offsetGet($this->uploadedImageKey) !== $upload->getUploadedFiles()->first()['name']) { |
|
| 379 | + $sets[$this->uploadedImageKey] = $upload->getUploadedFiles()->first()['name']; |
|
| 380 | 380 | |
| 381 | 381 | if (is_file($filePath = $this->uploadedImageFilePath . $row->offsetGet($this->uploadedImageKey))) { |
| 382 | 382 | unlink($filePath); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | } |
| 386 | 386 | } elseif (count($this->uploadedImageKeys)) { |
| 387 | 387 | foreach ($this->uploadedImageKeys as $uploadedImageKey) { |
| 388 | - if (isset($files[ $uploadedImageKey ])) { |
|
| 388 | + if (isset($files[$uploadedImageKey])) { |
|
| 389 | 389 | $upload->process($uploadedImageKey); |
| 390 | 390 | |
| 391 | 391 | if ($upload->getErrors()) { |
@@ -400,8 +400,8 @@ discard block |
||
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | return false; |
| 403 | - } elseif ($row->offsetGet($uploadedImageKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) { |
|
| 404 | - $sets[ $uploadedImageKey ] = $upload->getUploadedFiles()->first()[ 'name' ]; |
|
| 403 | + } elseif ($row->offsetGet($uploadedImageKey) !== $upload->getUploadedFiles()->first()['name']) { |
|
| 404 | + $sets[$uploadedImageKey] = $upload->getUploadedFiles()->first()['name']; |
|
| 405 | 405 | |
| 406 | 406 | if (is_file($filePath = $this->uploadedImageFilePath . $row->offsetGet($uploadedImageKey))) { |
| 407 | 407 | unlink($filePath); |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | |
| 414 | 414 | // Uploaded File Process |
| 415 | 415 | if (isset($this->uploadedFileFilepath)) { |
| 416 | - if (isset($files[ $this->uploadedFileKey ])) { |
|
| 416 | + if (isset($files[$this->uploadedFileKey])) { |
|
| 417 | 417 | $upload->process($this->uploadedFileKey); |
| 418 | 418 | |
| 419 | 419 | if ($upload->getErrors()) { |
@@ -428,8 +428,8 @@ discard block |
||
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | return false; |
| 431 | - } elseif ($row->offsetGet($this->uploadedFileKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) { |
|
| 432 | - $sets[ $this->uploadedFileKey ] = $upload->getUploadedFiles()->first()[ 'name' ]; |
|
| 431 | + } elseif ($row->offsetGet($this->uploadedFileKey) !== $upload->getUploadedFiles()->first()['name']) { |
|
| 432 | + $sets[$this->uploadedFileKey] = $upload->getUploadedFiles()->first()['name']; |
|
| 433 | 433 | |
| 434 | 434 | if (is_file($filePath = $this->uploadedFileFilepath . $row->offsetGet($this->uploadedFileKey))) { |
| 435 | 435 | unlink($filePath); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | } |
| 439 | 439 | } elseif (count($this->uploadedFileKeys)) { |
| 440 | 440 | foreach ($this->uploadedFileKeys as $uploadedFileKey) { |
| 441 | - if (isset($files[ $uploadedFileKey ])) { |
|
| 441 | + if (isset($files[$uploadedFileKey])) { |
|
| 442 | 442 | $upload->process($uploadedFileKey); |
| 443 | 443 | |
| 444 | 444 | if ($upload->getErrors()) { |
@@ -453,8 +453,8 @@ discard block |
||
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | return false; |
| 456 | - } elseif ($row->offsetGet($uploadedFileKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) { |
|
| 457 | - $sets[ $uploadedFileKey ] = $upload->getUploadedFiles()->first()[ 'name' ]; |
|
| 456 | + } elseif ($row->offsetGet($uploadedFileKey) !== $upload->getUploadedFiles()->first()['name']) { |
|
| 457 | + $sets[$uploadedFileKey] = $upload->getUploadedFiles()->first()['name']; |
|
| 458 | 458 | |
| 459 | 459 | if (is_file($filePath = $this->uploadedFileFilepath . $row->offsetGet($uploadedFileKey))) { |
| 460 | 460 | unlink($filePath); |
@@ -474,8 +474,8 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | $label = false; |
| 476 | 476 | foreach (['name', 'label', 'title', 'code'] as $labelField) { |
| 477 | - if (isset($sets[ $labelField ])) { |
|
| 478 | - session()->setFlash('success', language('SUCCESS_UPDATE_WITH_LABEL', $sets[ $labelField ])); |
|
| 477 | + if (isset($sets[$labelField])) { |
|
| 478 | + session()->setFlash('success', language('SUCCESS_UPDATE_WITH_LABEL', $sets[$labelField])); |
|
| 479 | 479 | $label = true; |
| 480 | 480 | break; |
| 481 | 481 | } |
@@ -492,8 +492,8 @@ discard block |
||
| 492 | 492 | |
| 493 | 493 | $label = false; |
| 494 | 494 | foreach (['name', 'label', 'title', 'code'] as $labelField) { |
| 495 | - if (isset($sets[ $labelField ])) { |
|
| 496 | - session()->setFlash('danger', language('FAILED_UPDATE_WITH_LABEL', $sets[ $labelField ])); |
|
| 495 | + if (isset($sets[$labelField])) { |
|
| 496 | + session()->setFlash('danger', language('FAILED_UPDATE_WITH_LABEL', $sets[$labelField])); |
|
| 497 | 497 | $label = true; |
| 498 | 498 | break; |
| 499 | 499 | } |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | |
| 541 | 541 | if (method_exists($this, 'updateRecordSets')) { |
| 542 | 542 | foreach ($sets as $key => $set) { |
| 543 | - $this->updateRecordSets($sets[ $key ]); |
|
| 543 | + $this->updateRecordSets($sets[$key]); |
|
| 544 | 544 | } |
| 545 | 545 | } |
| 546 | 546 | |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | */ |
| 757 | 757 | private function updateRecordStatus($id, $recordStatus, $method) |
| 758 | 758 | { |
| 759 | - $sets[ 'record_status' ] = $recordStatus; |
|
| 759 | + $sets['record_status'] = $recordStatus; |
|
| 760 | 760 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
| 761 | 761 | |
| 762 | 762 | if (method_exists($this, 'updateRecordSets')) { |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | private function updateRecordStatusMany(array $ids, $recordStatus, $method) |
| 797 | 797 | { |
| 798 | 798 | if (count($ids)) { |
| 799 | - $sets[ 'record_status' ] = $recordStatus; |
|
| 799 | + $sets['record_status'] = $recordStatus; |
|
| 800 | 800 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
| 801 | 801 | |
| 802 | 802 | $this->qb->whereIn($primaryKey, $ids); |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | private function updateRecordStatusBy($recordStatus, $method, array $conditions) |
| 842 | 842 | { |
| 843 | 843 | if (count($conditions)) { |
| 844 | - $sets[ 'record_status' ] = $recordStatus; |
|
| 844 | + $sets['record_status'] = $recordStatus; |
|
| 845 | 845 | |
| 846 | 846 | if (method_exists($this, 'updateRecordSets')) { |
| 847 | 847 | $this->updateRecordSets($sets); |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | private function updateRecordStatusManyBy($recordStatus, $method, array $conditions) |
| 884 | 884 | { |
| 885 | 885 | if (count($conditions)) { |
| 886 | - $sets[ 'record_status' ] = $recordStatus; |
|
| 886 | + $sets['record_status'] = $recordStatus; |
|
| 887 | 887 | |
| 888 | 888 | if (method_exists($this, 'updateRecordSets')) { |
| 889 | 889 | $this->updateRecordSets($sets); |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $ormResult[ $key ] = new Result\Row($row, $model); |
|
| 74 | + $ormResult[$key] = new Result\Row($row, $model); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | parent::__construct($ormResult->toArray()); |