original_string: public function getRecords()
      {
          $data = array();
  
          // List identifiers
          if (empty($this->metadataIterator)) {
              $this->metadataIterator = $this->endpoint->listMetadataFormats();
          } else {
              $this->metadataIterator->rewind(); // rewind the iterator
          }
  
          // Auto-determine a metadata prefix to use for getting records
          $mdPrefix = (string) $this->metadataIterator->current()->metadataPrefix;
  
          $data = array(
              'header' => array('Identifier', 'Title', 'usageDataResourceURL'),
              'rows' => array(),
          );
  
          // Iterate
          $recordIterator = $this->endpoint->listRecords($mdPrefix);
          for ($i = 0; $i < 10; $i++) {
              $rec = $recordIterator->next();
              $data['rows'][] = array(
                  $rec->header->identifier,
                  // Truncate title
                  substr($rec->metadata->commParadata->paradataTitle->string->__toString(), 0, 30),
                  $rec->metadata->commParadata->usageDataResourceURL
              );
          }
  
          return $data;
      }
code: public function getRecords()
      {
          $data = array();
  
          // List identifiers
          if (empty($this->metadataIterator)) {
              $this->metadataIterator = $this->endpoint->listMetadataFormats();
          } else {
              $this->metadataIterator->rewind(); // rewind the iterator
          }
  
          // Auto-determine a metadata prefix to use for getting records
          $mdPrefix = (string) $this->metadataIterator->current()->metadataPrefix;
  
          $data = array(
              'header' => array('Identifier', 'Title', 'usageDataResourceURL'),
              'rows' => array(),
          );
  
          // Iterate
          $recordIterator = $this->endpoint->listRecords($mdPrefix);
          for ($i = 0; $i < 10; $i++) {
              $rec = $recordIterator->next();
              $data['rows'][] = array(
                  $rec->header->identifier,
                  // Truncate title
                  substr($rec->metadata->commParadata->paradataTitle->string->__toString(), 0, 30),
                  $rec->metadata->commParadata->usageDataResourceURL
              );
          }
  
          return $data;
      }
code_tokens: public function getRecords ( ) { $ data = array ( ) ; // List identifiers if ( empty ( $ this -> metadataIterator ) ) { $ this -> metadataIterator = $ this -> endpoint -> listMetadataFormats ( ) ; } else { $ this -> metadataIterator -> rewind ( ) ; // rewind the iterator } // Auto-determine a metadata prefix to use for getting records $ mdPrefix = ( string ) $ this -> metadataIterator -> current ( ) -> metadataPrefix ; $ data = array ( 'header' => array ( 'Identifier' , 'Title' , 'usageDataResourceURL' ) , 'rows' => array ( ) , ) ; // Iterate $ recordIterator = $ this -> endpoint -> listRecords ( $ mdPrefix ) ; for ( $ i = 0 ; $ i < 10 ; $ i ++ ) { $ rec = $ recordIterator -> next ( ) ; $ data [ 'rows' ] [ ] = array ( $ rec -> header -> identifier , // Truncate title substr ( $ rec -> metadata -> commParadata -> paradataTitle -> string -> __toString ( ) , 0 , 30 ) , $ rec -> metadata -> commParadata -> usageDataResourceURL ) ; } return $ data ; }
docstring: Get a list of the first 10 records from the first available metadata
  format.
  
  @return array An array containing data in a tabular format.
docstring_tokens: Get a list of the first 10 records from the first available metadata format .