src/Payline/PaylineSDK.php
protected function responseToArray($node, $parent = null)
    {
        $array = array();
        foreach ($node as $k => $v) {
            if ($this->isChildFromList($k, $parent)) { // current value is a list
                if ($v instanceof \Countable && count($v) == 1 && $k != '0') { // a list with 1 element. It's returned with a 0-index
                    $array[$k][0] = PaylineSDK::responseToArray($v, $k);
                } elseif (is_object($v) || is_array($v)) { // a list with more than 1 element
                    $array[$k] = PaylineSDK::responseToArray($v, $k);
                } else {
                    $array[$k] = $v;
                }
            } else {
                if (is_object($v) || is_array($v)) {
                    $array[$k] = PaylineSDK::responseToArray($v, $k);
                } else {
                    $array[$k] = $v;
                }
            }
        }
        return $array;
    }
protected function responseToArray($node, $parent = null)
    {
        $array = array();
        foreach ($node as $k => $v) {
            if ($this->isChildFromList($k, $parent)) { // current value is a list
                if ($v instanceof \Countable && count($v) == 1 && $k != '0') { // a list with 1 element. It's returned with a 0-index
                    $array[$k][0] = PaylineSDK::responseToArray($v, $k);
                } elseif (is_object($v) || is_array($v)) { // a list with more than 1 element
                    $array[$k] = PaylineSDK::responseToArray($v, $k);
                } else {
                    $array[$k] = $v;
                }
            } else {
                if (is_object($v) || is_array($v)) {
                    $array[$k] = PaylineSDK::responseToArray($v, $k);
                } else {
                    $array[$k] = $v;
                }
            }
        }
        return $array;
    }
protected function responseToArray ( $ node , $ parent = null ) { $ array = array ( ) ; foreach ( $ node as $ k => $ v ) { if ( $ this -> isChildFromList ( $ k , $ parent ) ) { // current value is a list
 if ( $ v instanceof \ Countable && count ( $ v ) == 1 && $ k != '0' ) { // a list with 1 element. It's returned with a 0-index
 $ array [ $ k ] [ 0 ] = PaylineSDK :: responseToArray ( $ v , $ k ) ; } elseif ( is_object ( $ v ) || is_array ( $ v ) ) { // a list with more than 1 element
 $ array [ $ k ] = PaylineSDK :: responseToArray ( $ v , $ k ) ; } else { $ array [ $ k ] = $ v ; } } else { if ( is_object ( $ v ) || is_array ( $ v ) ) { $ array [ $ k ] = PaylineSDK :: responseToArray ( $ v , $ k ) ; } else { $ array [ $ k ] = $ v ; } } } return $ array ; }
make an array from a payline server response object.

@param object $node
response node from payline web service
@param string $parent
name of the node's parent
@return array representation of the object
make an array from a payline server response object .