@@ -132,8 +132,9 @@ discard block |
||
| 132 | 132 | $this->data[$table_name][] = $DataItem; |
| 133 | 133 | |
| 134 | 134 | } elseif (is_array($value)) {//reference table |
| 135 | - foreach ($value as $item_value) |
|
| 136 | - $DataItem[] = ['value' => $item_value]; |
|
| 135 | + foreach ($value as $item_value) { |
|
| 136 | + $DataItem[] = ['value' => $item_value]; |
|
| 137 | + } |
|
| 137 | 138 | |
| 138 | 139 | $this->data[$table_name] = array_merge(($this->data[$table_name]??[]),$DataItem); |
| 139 | 140 | |
@@ -167,23 +168,25 @@ discard block |
||
| 167 | 168 | ]; |
| 168 | 169 | } |
| 169 | 170 | |
| 170 | - if ($this->snake_case_column) |
|
| 171 | - return [ |
|
| 171 | + if ($this->snake_case_column) { |
|
| 172 | + return [ |
|
| 172 | 173 | 'name' => $table, |
| 173 | 174 | 'column' => array_map(function ($item) { |
| 174 | 175 | return [ |
| 175 | 176 | 'name' => $this->snakeCase($item['name']), |
| 176 | 177 | 'type' => $item['type'] |
| 177 | 178 | ]; |
| 179 | + } |
|
| 178 | 180 | |
| 179 | 181 | }, $last_columns) |
| 180 | 182 | ]; |
| 181 | 183 | |
| 182 | - else |
|
| 183 | - return [ |
|
| 184 | + else { |
|
| 185 | + return [ |
|
| 184 | 186 | 'name' => $table, |
| 185 | 187 | 'column' => $last_columns |
| 186 | 188 | ]; |
| 189 | + } |
|
| 187 | 190 | } |
| 188 | 191 | |
| 189 | 192 | /** |