@@ -43,13 +43,15 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function export() |
| 45 | 45 | { |
| 46 | - if (!\Yii::$app) |
|
| 47 | - // Things like this can happen in tests etc, but it is too late for us to do anything about that. |
|
| 46 | + if (!\Yii::$app) { |
|
| 47 | + // Things like this can happen in tests etc, but it is too late for us to do anything about that. |
|
| 48 | 48 | return; |
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | $module = $this->module; |
| 51 | - if (!$module->entry || empty($module->panels)) |
|
| 52 | - return; |
|
| 52 | + if (!$module->entry || empty($module->panels)) { |
|
| 53 | + return; |
|
| 54 | + } |
|
| 53 | 55 | |
| 54 | 56 | $entry = $module->entry; |
| 55 | 57 | |
@@ -60,11 +62,12 @@ discard block |
||
| 60 | 62 | $records = array_filter($records); |
| 61 | 63 | |
| 62 | 64 | if (!empty($records)) { |
| 63 | - if ($module->batchSave) |
|
| 64 | - $entry->addBatchData($records, false); |
|
| 65 | - else { |
|
| 66 | - foreach ($records as $type => $record) |
|
| 67 | - $entry->addData($type, $record, false); |
|
| 65 | + if ($module->batchSave) { |
|
| 66 | + $entry->addBatchData($records, false); |
|
| 67 | + } else { |
|
| 68 | + foreach ($records as $type => $record) { |
|
| 69 | + $entry->addData($type, $record, false); |
|
| 70 | + } |
|
| 68 | 71 | } |
| 69 | 72 | } |
| 70 | 73 | } |
@@ -77,8 +80,7 @@ discard block |
||
| 77 | 80 | { |
| 78 | 81 | if ($this->exportAtIntervals) { |
| 79 | 82 | parent::collect($messages, $final); |
| 80 | - } |
|
| 81 | - else { |
|
| 83 | + } else { |
|
| 82 | 84 | $this->messages = array_merge($this->messages, static::filterMessages($messages, $this->getLevels(), $this->categories, $this->except)); |
| 83 | 85 | if ($final) { |
| 84 | 86 | $this->export(); |