Skip to content

Commit 5658096

Browse files
committed
make it work to be able to select the whole relationship
1 parent b859fce commit 5658096

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/Processors/DataProcessor.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,12 @@ protected function selectOnlyNeededColumns(array $data)
179179
if (is_null($this->onlyColumns)) {
180180
return $data;
181181
} else {
182-
$dotted_array = array_intersect_key(
183-
array_dot($data),
184-
array_flip(array_merge($this->onlyColumns, $this->exceptions))
185-
);
186-
187-
$nested_array = [];
188-
foreach ($dotted_array as $key => $value) {
189-
array_set($nested_array, $key, $value);
182+
$results = [];
183+
foreach (array_merge($this->onlyColumns, $this->exceptions) as $column) {
184+
Arr::set($results, $column, Arr::get($data, $column));
190185
}
191186

192-
return $nested_array;
187+
return $results;
193188
}
194189
}
195190

0 commit comments

Comments
 (0)