protected function _flattenParams(array $params, FilterCollectionInterface $filters)
    {
        $flattened = [];
        foreach ($params as $key => $value) {
            if (!is_array($value) ||
                (!empty($filters[$key]) && $filters[$key]->getConfig('flatten') === false)
            ) {
                $flattened[$key] = $value;
                continue;
            }

            foreach ($value as $childKey => $childValue) {
                if (!is_numeric($childKey)) {
                    $flattened[$key . '.' . $childKey] = $childValue;
                } else {
                    $flattened[$key][$childKey] = $childValue;
                }
            }
        }

        return $flattened;
    }
protected function _flattenParams(array $params, FilterCollectionInterface $filters)
    {
        $flattened = [];
        foreach ($params as $key => $value) {
            if (!is_array($value) ||
                (!empty($filters[$key]) && $filters[$key]->getConfig('flatten') === false)
            ) {
                $flattened[$key] = $value;
                continue;
            }

            foreach ($value as $childKey => $childValue) {
                if (!is_numeric($childKey)) {
                    $flattened[$key . '.' . $childKey] = $childValue;
                } else {
                    $flattened[$key][$childKey] = $childValue;
                }
            }
        }

        return $flattened;
    }
protected function _flattenParams ( array $ params , FilterCollectionInterface $ filters ) { $ flattened = [ ] ; foreach ( $ params as $ key => $ value ) { if ( ! is_array ( $ value ) || ( ! empty ( $ filters [ $ key ] ) && $ filters [ $ key ] -> getConfig ( 'flatten' ) === false ) ) { $ flattened [ $ key ] = $ value ; continue ; } foreach ( $ value as $ childKey => $ childValue ) { if ( ! is_numeric ( $ childKey ) ) { $ flattened [ $ key . '.' . $ childKey ] = $ childValue ; } else { $ flattened [ $ key ] [ $ childKey ] = $ childValue ; } } } return $ flattened ; }
Flattens a parameters array, so that possible aliased parameter
keys that are provided in a nested fashion, are being grouped
using flat keys.

### Example:

The following parameters array:

```
[
'Alias' => [
'field' => 'value'
'otherField' => [
'value',
'otherValue'
]
],
'field' => 'value'
]
```

would return as

```
[
'Alias.field' => 'value',
'Alias.otherField' => [
'value',
'otherValue'
],
'field' => 'value'
]
```

@param array $params The parameters array to flatten.
@param \Search\Model\Filter\FilterCollectionInterface $filters Filter collection instance.
@return array The flattened parameters array.
Flattens a parameters array so that possible aliased parameter keys that are provided in a nested fashion are being grouped using flat keys .