src/Api/StatementsApiClient.php
private function doGetStatements($url, array $urlParameters = array())
    {
        $request = $this->requestHandler->createRequest('get', $url, $urlParameters);
        $response = $this->requestHandler->executeRequest($request, array(200));

        $contentType = $response->getHeader('Content-Type')[0];
        $body = (string) $response->getBody();
        $attachments = array();

        if (false !== strpos($contentType, 'application/json')) {
            $serializedStatement = $body;
        } else {
            $boundary = substr($contentType, strpos($contentType, '=') + 1);
            $parts = $this->parseMultipartResponseBody($body, $boundary);
            $serializedStatement = $parts[0]['content'];

            unset($parts[0]);

            foreach ($parts as $part) {
                $attachments[$part['headers']['X-Experience-API-Hash'][0]] = array(
                    'type' => $part['headers']['Content-Type'][0],
                    'content' => $part['content'],
                );
            }
        }

        if (isset($urlParameters['statementId']) || isset($urlParameters['voidedStatementId'])) {
            return $this->statementSerializer->deserializeStatement($serializedStatement, $attachments);
        } else {
            return $this->statementResultSerializer->deserializeStatementResult($serializedStatement, $attachments);
        }
    }
private function doGetStatements($url, array $urlParameters = array())
    {
        $request = $this->requestHandler->createRequest('get', $url, $urlParameters);
        $response = $this->requestHandler->executeRequest($request, array(200));

        $contentType = $response->getHeader('Content-Type')[0];
        $body = (string) $response->getBody();
        $attachments = array();

        if (false !== strpos($contentType, 'application/json')) {
            $serializedStatement = $body;
        } else {
            $boundary = substr($contentType, strpos($contentType, '=') + 1);
            $parts = $this->parseMultipartResponseBody($body, $boundary);
            $serializedStatement = $parts[0]['content'];

            unset($parts[0]);

            foreach ($parts as $part) {
                $attachments[$part['headers']['X-Experience-API-Hash'][0]] = array(
                    'type' => $part['headers']['Content-Type'][0],
                    'content' => $part['content'],
                );
            }
        }

        if (isset($urlParameters['statementId']) || isset($urlParameters['voidedStatementId'])) {
            return $this->statementSerializer->deserializeStatement($serializedStatement, $attachments);
        } else {
            return $this->statementResultSerializer->deserializeStatementResult($serializedStatement, $attachments);
        }
    }
private function doGetStatements ( $ url , array $ urlParameters = array ( ) ) { $ request = $ this -> requestHandler -> createRequest ( 'get' , $ url , $ urlParameters ) ; $ response = $ this -> requestHandler -> executeRequest ( $ request , array ( 200 ) ) ; $ contentType = $ response -> getHeader ( 'Content-Type' ) [ 0 ] ; $ body = ( string ) $ response -> getBody ( ) ; $ attachments = array ( ) ; if ( false !== strpos ( $ contentType , 'application/json' ) ) { $ serializedStatement = $ body ; } else { $ boundary = substr ( $ contentType , strpos ( $ contentType , '=' ) + 1 ) ; $ parts = $ this -> parseMultipartResponseBody ( $ body , $ boundary ) ; $ serializedStatement = $ parts [ 0 ] [ 'content' ] ; unset ( $ parts [ 0 ] ) ; foreach ( $ parts as $ part ) { $ attachments [ $ part [ 'headers' ] [ 'X-Experience-API-Hash' ] [ 0 ] ] = array ( 'type' => $ part [ 'headers' ] [ 'Content-Type' ] [ 0 ] , 'content' => $ part [ 'content' ] , ) ; } } if ( isset ( $ urlParameters [ 'statementId' ] ) || isset ( $ urlParameters [ 'voidedStatementId' ] ) ) { return $ this -> statementSerializer -> deserializeStatement ( $ serializedStatement , $ attachments ) ; } else { return $ this -> statementResultSerializer -> deserializeStatementResult ( $ serializedStatement , $ attachments ) ; } }
Fetch one or more Statements.

@param string $url           URL to request
@param array  $urlParameters URL parameters

@return Statement|StatementResult
Fetch one or more Statements .