protected function convertArrayObjects($data)
    {
        if ($data instanceof Json\ArrayObject) {
            // @todo: Check if we need to convert arrays with only one single
            // element into non-arrays /cc cba
            $data = $data->getArrayCopy();
            foreach ($data as $key => $value) {
                $data[$key] = $this->convertArrayObjects($value);
            }
        } elseif ($data instanceof Json\JsonObject) {
            foreach ($data as $key => $value) {
                $data->$key = $this->convertArrayObjects($value);
            }
        }

        return $data;
    }
protected function convertArrayObjects($data)
    {
        if ($data instanceof Json\ArrayObject) {
            // @todo: Check if we need to convert arrays with only one single
            // element into non-arrays /cc cba
            $data = $data->getArrayCopy();
            foreach ($data as $key => $value) {
                $data[$key] = $this->convertArrayObjects($value);
            }
        } elseif ($data instanceof Json\JsonObject) {
            foreach ($data as $key => $value) {
                $data->$key = $this->convertArrayObjects($value);
            }
        }

        return $data;
    }
protected function convertArrayObjects ( $ data ) { if ( $ data instanceof Json \ ArrayObject ) { // @todo: Check if we need to convert arrays with only one single // element into non-arrays /cc cba $ data = $ data -> getArrayCopy ( ) ; foreach ( $ data as $ key => $ value ) { $ data [ $ key ] = $ this -> convertArrayObjects ( $ value ) ; } } elseif ( $ data instanceof Json \ JsonObject ) { foreach ( $ data as $ key => $ value ) { $ data -> $ key = $ this -> convertArrayObjects ( $ value ) ; } } return $ data ; }
Convert ArrayObjects to arrays.

Recursively convert all ArrayObjects into arrays in the full data
structure.

@param mixed $data

@return mixed
Convert ArrayObjects to arrays .