Skip to content

Fix class NestedArrayAdapter in method convertToArray #98

Open
@smirkos

Description

@smirkos

This is my solution and work for me ;)

Model/Adapters/NestedArrayAdapter.php

protected function convertToArray(&$line)
    {
        $implodeStr = $this->multipleValueSeparator;
        $arr = array_map(
            function ($value, $key) use (&$implodeStr) {
                if (is_array($value) && is_numeric($key)) {
                    $this->convertToArray($value);
                    $implodeStr = '|';
                    return $value;
                } 
                //FIX
                elseif(is_numeric($key) && !is_array($value)) {
                    return $value;
                }
                return sprintf("%s=%s", $key, $value);
                //END FIX
            },
            $line,
            array_keys($line)
        );

        $line = implode(
            $implodeStr, $arr
        );
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions