original_string: 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);
              }
          }
      }
code: 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);
              }
          }
      }
code_tokens: 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 ) ; } } }
docstring: 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
docstring_tokens: Parse response document containing multiple records