protected function parseMultiRecordResult($objectName, $data)
    {
        $this->resultCount = (int) $data['result']['total_results'];

        if (0 === $this->resultCount) {
            $this->result = array();
        } else {
            if (array_key_exists($objectName, $data['result'])) {
                if ($this->resultHasOnlyOneRecord($objectName, $data)) {
                    $this->result = array($data['result'][$objectName]);
                } else {
                    $this->result = $data['result'][$objectName];
                }
            } else {
                $msg = sprintf('The response does not contain the expected object key \'%s\'', $objectName);

                throw new InvalidArgumentException($msg);
            }
        }
    }
protected function parseMultiRecordResult($objectName, $data)
    {
        $this->resultCount = (int) $data['result']['total_results'];

        if (0 === $this->resultCount) {
            $this->result = array();
        } else {
            if (array_key_exists($objectName, $data['result'])) {
                if ($this->resultHasOnlyOneRecord($objectName, $data)) {
                    $this->result = array($data['result'][$objectName]);
                } else {
                    $this->result = $data['result'][$objectName];
                }
            } else {
                $msg = sprintf('The response does not contain the expected object key \'%s\'', $objectName);

                throw new InvalidArgumentException($msg);
            }
        }
    }
protected function parseMultiRecordResult ( $ objectName , $ data ) { $ this -> resultCount = ( int ) $ data [ 'result' ] [ 'total_results' ] ; if ( 0 === $ this -> resultCount ) { $ this -> result = array ( ) ; } else { if ( array_key_exists ( $ objectName , $ data [ 'result' ] ) ) { if ( $ this -> resultHasOnlyOneRecord ( $ objectName , $ data ) ) { $ this -> result = array ( $ data [ 'result' ] [ $ objectName ] ) ; } else { $ this -> result = $ data [ 'result' ] [ $ objectName ] ; } } else { $ msg = sprintf ( 'The response does not contain the expected object key \'%s\'' , $ objectName ) ; throw new InvalidArgumentException ( $ msg ) ; } } }
Parse response document containing multiple records

@param string $objectName The name of the Pardot object being requested
@param array  $data       The data as an associative array

@access protected
@throws InvalidArgumentException
@return void
Parse response document containing multiple records