fiedsch / datamanagement

Data management helpers (PHP-CLI)
MIT License
2 stars 0 forks source link

Side effect :-( #1

Closed fiedsch closed 5 years ago

fiedsch commented 5 years ago

Fix the problem, that Augmentor::setRequiredColumns(array $colnames) also determines the order in which the augmented columns are output in Augmetor::augment($data)

See https://github.com/fiedsch/datamanagement/blob/master/src/Fiedsch/Data/Augmentation/Augmentor.php#L80

Solution might be to introduce something like

const KEY_COLORDER = 'column_output_order';

and

Augmentor::setOutputColumnOrder($an_array_of_column_names);

Additionally comparing the column names set by

Augmentor::setRequiredColumns($colnames);

and

Augmentor::setOutputColumnOrder($colnames);

might be a good idea.