How to overwrite dataSet values?


#1

According to

It seems like you can modify the data by adding a step.According to

you can override the array key by providing it with a new value. However, this is not possible with a step looking like this:
public function execute(DataSetInterface $dataSet)
{
foreach($dataSet[‘localizedAttributes’] as $idLocale => $data){
if(!empty($dataSet[‘attributes’][‘name’]) && empty($dataSet[‘localizedAttributes’][$idLocale][‘name’])){
$dataSet[‘localizedAttributes’][$idLocale][‘name’] = $dataSet[‘attributes’][‘name’];
}
}
}

As it yields Indirect modification of overloaded element of Spryker\\Zed\\DataImport\\Business\\Model\\DataSet\\DataSet has no effect

How should we adjust the dataset in such case?