We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 110 |
| Total Lines | 759 |
| Duplicated Lines | 0 % |
| Changes | 10 | ||
| Bugs | 0 | Features | 0 |
Complex classes like OaiPmhController often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use OaiPmhController, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 29 | class OaiPmhController extends AbstractController |
||
| 30 | { |
||
| 31 | /** |
||
| 32 | * @var TokenRepository |
||
| 33 | */ |
||
| 34 | protected $tokenRepository; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param TokenRepository $tokenRepository |
||
| 38 | */ |
||
| 39 | public function injectTokenRepository(TokenRepository $tokenRepository) |
||
| 40 | { |
||
| 41 | $this->tokenRepository = $tokenRepository; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var CollectionRepository |
||
| 46 | */ |
||
| 47 | protected $collectionRepository; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param CollectionRepository $collectionRepository |
||
| 51 | */ |
||
| 52 | public function injectCollectionRepository(CollectionRepository $collectionRepository) |
||
| 53 | { |
||
| 54 | $this->collectionRepository = $collectionRepository; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @var LibraryRepository |
||
| 59 | */ |
||
| 60 | protected $libraryRepository; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param LibraryRepository $libraryRepository |
||
| 64 | */ |
||
| 65 | public function injectLibraryRepository(LibraryRepository $libraryRepository) |
||
| 66 | { |
||
| 67 | $this->libraryRepository = $libraryRepository; |
||
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Initializes the current action |
||
| 72 | * |
||
| 73 | * @return void |
||
| 74 | */ |
||
| 75 | public function initializeAction() |
||
| 76 | { |
||
| 77 | $this->request->setFormat('xml'); |
||
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * Did an error occur? |
||
| 82 | * |
||
| 83 | * @var string |
||
| 84 | * @access protected |
||
| 85 | */ |
||
| 86 | protected $error; |
||
| 87 | |||
| 88 | /** |
||
| 89 | * This holds the configuration for all supported metadata prefixes |
||
| 90 | * |
||
| 91 | * @var array |
||
| 92 | * @access protected |
||
| 93 | */ |
||
| 94 | protected $formats = [ |
||
| 95 | 'oai_dc' => [ |
||
| 96 | 'schema' => 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', |
||
| 97 | 'namespace' => 'http://www.openarchives.org/OAI/2.0/oai_dc/', |
||
| 98 | 'requiredFields' => ['record_id'], |
||
| 99 | ], |
||
| 100 | 'epicur' => [ |
||
| 101 | 'schema' => 'http://www.persistent-identifier.de/xepicur/version1.0/xepicur.xsd', |
||
| 102 | 'namespace' => 'urn:nbn:de:1111-2004033116', |
||
| 103 | 'requiredFields' => ['purl', 'urn'], |
||
| 104 | ], |
||
| 105 | 'mets' => [ |
||
| 106 | 'schema' => 'http://www.loc.gov/standards/mets/version17/mets.v1-7.xsd', |
||
| 107 | 'namespace' => 'http://www.loc.gov/METS/', |
||
| 108 | 'requiredFields' => ['location'], |
||
| 109 | ] |
||
| 110 | ]; |
||
| 111 | |||
| 112 | /** |
||
| 113 | * @var array |
||
| 114 | */ |
||
| 115 | protected $parameters = []; |
||
| 116 | |||
| 117 | /** |
||
| 118 | * Delete expired resumption tokens |
||
| 119 | * |
||
| 120 | * @access protected |
||
| 121 | * |
||
| 122 | * @return void |
||
| 123 | */ |
||
| 124 | protected function deleteExpiredTokens() |
||
| 125 | { |
||
| 126 | // Delete expired resumption tokens. |
||
| 127 | $this->tokenRepository->deleteExpiredTokens($this->settings['expired']); |
||
| 128 | } |
||
| 129 | |||
| 130 | /** |
||
| 131 | * Load URL parameters |
||
| 132 | * |
||
| 133 | * @access protected |
||
| 134 | * |
||
| 135 | * @return void |
||
| 136 | */ |
||
| 137 | protected function getUrlParams() |
||
| 138 | { |
||
| 139 | $allowedParams = [ |
||
| 140 | 'verb', |
||
| 141 | 'identifier', |
||
| 142 | 'metadataPrefix', |
||
| 143 | 'from', |
||
| 144 | 'until', |
||
| 145 | 'set', |
||
| 146 | 'resumptionToken' |
||
| 147 | ]; |
||
| 148 | // Clear plugin variables. |
||
| 149 | $this->parameters = []; |
||
| 150 | // Set only allowed parameters. |
||
| 151 | foreach ($allowedParams as $param) { |
||
| 152 | if (GeneralUtility::_GP($param)) { |
||
| 153 | $this->parameters[$param] = GeneralUtility::_GP($param); |
||
| 154 | } |
||
| 155 | } |
||
| 156 | } |
||
| 157 | |||
| 158 | /** |
||
| 159 | * Get unqualified Dublin Core data. |
||
| 160 | * @see http://www.openarchives.org/OAI/openarchivesprotocol.html#dublincore |
||
| 161 | * |
||
| 162 | * @access protected |
||
| 163 | * |
||
| 164 | * @param array $record : The full record array |
||
| 165 | * |
||
| 166 | * @return array $metadata: The mapped metadata array |
||
| 167 | */ |
||
| 168 | protected function getDcData(array $record) |
||
| 221 | } |
||
| 222 | |||
| 223 | |||
| 224 | /** |
||
| 225 | * Get METS data. |
||
| 226 | * @see http://www.loc.gov/standards/mets/docs/mets.v1-7.html |
||
| 227 | * |
||
| 228 | * @access protected |
||
| 229 | * |
||
| 230 | * @param array $record : The full record array |
||
| 231 | * |
||
| 232 | * @return string: The fetched METS XML |
||
| 233 | */ |
||
| 234 | protected function getMetsData(array $record) |
||
| 235 | { |
||
| 236 | $mets = null; |
||
| 237 | // Load METS file. |
||
| 238 | $xml = new \DOMDocument(); |
||
| 239 | if ($xml->load($record['location'])) { |
||
| 240 | // Get root element. |
||
| 241 | $root = $xml->getElementsByTagNameNS($this->formats['mets']['namespace'], 'mets'); |
||
| 242 | if ($root->item(0) instanceof \DOMNode) { |
||
| 243 | $mets = $xml->saveXML($root->item(0)); |
||
| 244 | } else { |
||
| 245 | $this->logger->error('No METS part found in document with location "' . $record['location'] . '"'); |
||
| 246 | } |
||
| 247 | } else { |
||
| 248 | $this->logger->error('Could not load XML file from "' . $record['location'] . '"'); |
||
| 249 | } |
||
| 250 | return $mets; |
||
| 251 | } |
||
| 252 | |||
| 253 | /** |
||
| 254 | * The main method of the plugin |
||
| 255 | * |
||
| 256 | * @return void |
||
| 257 | */ |
||
| 258 | public function mainAction() |
||
| 259 | { |
||
| 260 | // Get allowed GET and POST variables. |
||
| 261 | $this->getUrlParams(); |
||
| 262 | |||
| 263 | // Delete expired resumption tokens. |
||
| 264 | $this->deleteExpiredTokens(); |
||
| 265 | |||
| 266 | switch ($this->parameters['verb']) { |
||
| 267 | case 'GetRecord': |
||
| 268 | $this->verbGetRecord(); |
||
| 269 | break; |
||
| 270 | case 'Identify': |
||
| 271 | $this->verbIdentify(); |
||
| 272 | break; |
||
| 273 | case 'ListIdentifiers': |
||
| 274 | $this->verbListIdentifiers(); |
||
| 275 | break; |
||
| 276 | case 'ListMetadataFormats': |
||
| 277 | $this->verbListMetadataFormats(); |
||
| 278 | break; |
||
| 279 | case 'ListRecords': |
||
| 280 | $this->verbListRecords(); |
||
| 281 | break; |
||
| 282 | case 'ListSets': |
||
| 283 | $this->verbListSets(); |
||
| 284 | break; |
||
| 285 | default: |
||
| 286 | $this->error = 'badVerb'; |
||
| 287 | break; |
||
| 288 | } |
||
| 289 | |||
| 290 | $this->view->assign('parameters', $this->parameters); |
||
| 291 | $this->view->assign('error', $this->error); |
||
| 292 | |||
| 293 | return; |
||
| 294 | } |
||
| 295 | |||
| 296 | /** |
||
| 297 | * Continue with resumption token |
||
| 298 | * |
||
| 299 | * @access protected |
||
| 300 | * |
||
| 301 | * @return array|null list of uids |
||
| 302 | */ |
||
| 303 | protected function resume(): ?array |
||
| 316 | } |
||
| 317 | } |
||
| 318 | |||
| 319 | /** |
||
| 320 | * Process verb "GetRecord" |
||
| 321 | * |
||
| 322 | * @access protected |
||
| 323 | * |
||
| 324 | * @return void |
||
| 325 | */ |
||
| 326 | protected function verbGetRecord() |
||
| 370 | } |
||
| 371 | |||
| 372 | /** |
||
| 373 | * Process verb "Identify" |
||
| 374 | * |
||
| 375 | * @access protected |
||
| 376 | * |
||
| 377 | * @return void |
||
| 378 | */ |
||
| 379 | protected function verbIdentify() |
||
| 380 | { |
||
| 381 | $library = $this->libraryRepository->findByUid($this->settings['library']); |
||
| 382 | |||
| 383 | $oaiIdentifyInfo = []; |
||
| 384 | |||
| 385 | if (!$oaiIdentifyInfo) { |
||
| 386 | $this->logger->notice('Incomplete plugin configuration'); |
||
| 387 | } |
||
| 388 | |||
| 389 | $oaiIdentifyInfo['oai_label'] = $library->getOaiLabel(); |
||
| 390 | // Use default values for an installation with incomplete plugin configuration. |
||
| 391 | if (empty($oaiIdentifyInfo['oai_label'])) { |
||
| 392 | $oaiIdentifyInfo['oai_label'] = 'Kitodo.Presentation OAI-PMH Interface (default configuration)'; |
||
| 393 | $this->logger->notice('Incomplete plugin configuration (oai_label is missing)'); |
||
| 394 | } |
||
| 395 | |||
| 396 | $oaiIdentifyInfo['contact'] = $library->getContact(); |
||
| 397 | if (empty($oaiIdentifyInfo['contact'])) { |
||
| 398 | $oaiIdentifyInfo['contact'] = '[email protected]'; |
||
| 399 | $this->logger->notice('Incomplete plugin configuration (contact is missing)'); |
||
| 400 | } |
||
| 401 | |||
| 402 | $document = $this->documentRepository->findOldestDocument(); |
||
| 403 | |||
| 404 | if ($document) { |
||
| 405 | $oaiIdentifyInfo['earliestDatestamp'] = gmdate('Y-m-d\TH:i:s\Z', $document->getTstamp()->getTimestamp()); |
||
| 406 | } else { |
||
| 407 | // Provide a fallback timestamp if no document is found |
||
| 408 | $oaiIdentifyInfo['earliestDatestamp'] = '0000-00-00T00:00:00Z'; |
||
| 409 | |||
| 410 | // access storagePid from TypoScript |
||
| 411 | $pageSettings = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FULL_TYPOSCRIPT); |
||
| 412 | $storagePid = $pageSettings["plugin."]["tx_dlf."]["persistence."]["storagePid"]; |
||
| 413 | if ($storagePid > 0) { |
||
| 414 | $this->logger->notice('No records found with PID ' . $storagePid); |
||
| 415 | } else { |
||
| 416 | $this->logger->notice('No records found'); |
||
| 417 | } |
||
| 418 | } |
||
| 419 | $this->view->assign('oaiIdentifyInfo', $oaiIdentifyInfo); |
||
| 420 | } |
||
| 421 | |||
| 422 | /** |
||
| 423 | * Process verb "ListIdentifiers" |
||
| 424 | * |
||
| 425 | * @access protected |
||
| 426 | * |
||
| 427 | * @return void |
||
| 428 | */ |
||
| 429 | protected function verbListIdentifiers() |
||
| 430 | { |
||
| 431 | // If we have a resumption token we can continue our work |
||
| 432 | if (!empty($this->parameters['resumptionToken'])) { |
||
| 433 | // "resumptionToken" is an exclusive argument. |
||
| 434 | if (count($this->parameters) > 2) { |
||
| 435 | $this->error = 'badArgument'; |
||
| 436 | return; |
||
| 437 | } else { |
||
| 438 | // return next chunk of documents |
||
| 439 | $resultSet = $this->resume(); |
||
| 440 | if (is_array($resultSet)) { |
||
| 441 | $listIdentifiers = $this->generateOutputForDocumentList($resultSet); |
||
| 442 | $this->view->assign('listIdentifiers', $listIdentifiers); |
||
| 443 | } |
||
| 444 | return; |
||
| 445 | } |
||
| 446 | } |
||
| 447 | // "metadataPrefix" is required and "identifier" is not allowed. |
||
| 448 | if (empty($this->parameters['metadataPrefix']) || !empty($this->parameters['identifier'])) { |
||
| 449 | $this->error = 'badArgument'; |
||
| 450 | return; |
||
| 451 | } |
||
| 452 | if (!in_array($this->parameters['metadataPrefix'], array_keys($this->formats))) { |
||
| 453 | $this->error = 'cannotDisseminateFormat'; |
||
| 454 | return; |
||
| 455 | } |
||
| 456 | try { |
||
| 457 | $documentSet = $this->fetchDocumentUIDs(); |
||
| 458 | } catch (\Exception $exception) { |
||
| 459 | $this->error = 'idDoesNotExist'; |
||
| 460 | return; |
||
| 461 | } |
||
| 462 | // create new and empty documentlist |
||
| 463 | $resultSet = []; |
||
| 464 | if (is_array($documentSet)) { |
||
| 465 | $resultSet['elements'] = $documentSet; |
||
| 466 | $resultSet['metadata'] = [ |
||
| 467 | 'cursor' => 0, |
||
| 468 | 'completeListSize' => count($documentSet), |
||
| 469 | 'metadataPrefix' => $this->parameters['metadataPrefix'], |
||
| 470 | ]; |
||
| 471 | } |
||
| 472 | |||
| 473 | $listIdentifiers = $this->generateOutputForDocumentList($resultSet); |
||
| 474 | $this->view->assign('listIdentifiers', $listIdentifiers); |
||
| 475 | } |
||
| 476 | |||
| 477 | /** |
||
| 478 | * Process verb "ListMetadataFormats" |
||
| 479 | * |
||
| 480 | * @access protected |
||
| 481 | * |
||
| 482 | * @return void |
||
| 483 | */ |
||
| 484 | protected function verbListMetadataFormats() |
||
| 508 | } |
||
| 509 | |||
| 510 | /** |
||
| 511 | * Process verb "ListRecords" |
||
| 512 | * |
||
| 513 | * @access protected |
||
| 514 | * |
||
| 515 | * @return void |
||
| 516 | */ |
||
| 517 | protected function verbListRecords() |
||
| 518 | { |
||
| 519 | // Check for invalid arguments. |
||
| 520 | if (!empty($this->parameters['resumptionToken'])) { |
||
| 521 | // "resumptionToken" is an exclusive argument. |
||
| 522 | if (count($this->parameters) > 2) { |
||
| 523 | $this->error = 'badArgument'; |
||
| 524 | return; |
||
| 525 | } else { |
||
| 526 | // return next chunk of documents |
||
| 527 | $resultSet = $this->resume(); |
||
| 528 | if (is_array($resultSet)) { |
||
| 529 | $listRecords = $this->generateOutputForDocumentList($resultSet); |
||
| 530 | $this->parameters['metadataPrefix'] = $resultSet['metadata']['metadataPrefix']; |
||
| 531 | $this->view->assign('listRecords', $listRecords); |
||
| 532 | } |
||
| 533 | return; |
||
| 534 | } |
||
| 535 | } |
||
| 536 | if (empty($this->parameters['metadataPrefix']) || !empty($this->parameters['identifier'])) { |
||
| 537 | // "metadataPrefix" is required and "identifier" is not allowed. |
||
| 538 | $this->error = 'badArgument'; |
||
| 539 | return; |
||
| 540 | } |
||
| 541 | // Check "metadataPrefix" for valid value. |
||
| 542 | if (!in_array($this->parameters['metadataPrefix'], array_keys($this->formats))) { |
||
| 543 | $this->error = 'cannotDisseminateFormat'; |
||
| 544 | return; |
||
| 545 | } |
||
| 546 | try { |
||
| 547 | $documentSet = $this->fetchDocumentUIDs(); |
||
| 548 | } catch (\Exception $exception) { |
||
| 549 | $this->error = 'idDoesNotExist'; |
||
| 550 | return; |
||
| 551 | } |
||
| 552 | $resultSet = []; |
||
| 553 | if (is_array($documentSet)) { |
||
| 554 | $resultSet['elements'] = $documentSet; |
||
| 555 | $resultSet['metadata'] = [ |
||
| 556 | 'cursor' => 0, |
||
| 557 | 'completeListSize' => count($documentSet), |
||
| 558 | 'metadataPrefix' => $this->parameters['metadataPrefix'], |
||
| 559 | ]; |
||
| 560 | } |
||
| 561 | |||
| 562 | $resultSet = $this->generateOutputForDocumentList($resultSet); |
||
| 563 | $this->view->assign('listRecords', $resultSet); |
||
| 564 | } |
||
| 565 | |||
| 566 | /** |
||
| 567 | * Process verb "ListSets" |
||
| 568 | * |
||
| 569 | * @access protected |
||
| 570 | * |
||
| 571 | * @return void |
||
| 572 | */ |
||
| 573 | protected function verbListSets() |
||
| 574 | { |
||
| 575 | // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin. |
||
| 576 | $this->settings['hideEmptyOaiNames'] = true; |
||
| 577 | |||
| 578 | $oaiSets = $this->collectionRepository->findCollectionsBySettings($this->settings); |
||
| 579 | |||
| 580 | $this->view->assign('oaiSets', $oaiSets); |
||
| 581 | } |
||
| 582 | |||
| 583 | /** |
||
| 584 | * Fetch records |
||
| 585 | * |
||
| 586 | * @access protected |
||
| 587 | * |
||
| 588 | * @return array|null Array of matching records |
||
| 589 | */ |
||
| 590 | protected function fetchDocumentUIDs() |
||
| 591 | { |
||
| 592 | $solr_query = ''; |
||
| 593 | // Check "set" for valid value. |
||
| 594 | if (!empty($this->parameters['set'])) { |
||
| 595 | // For SOLR we need the index_name of the collection, |
||
| 596 | // For DB Query we need the UID of the collection |
||
| 597 | |||
| 598 | $result = $this->collectionRepository->getIndexNameForSolr($this->settings, $this->parameters['set']); |
||
| 599 | |||
| 600 | if ($resArray = $result->fetch()) { |
||
| 601 | if ($resArray['index_query'] != "") { |
||
| 602 | $solr_query .= '(' . $resArray['index_query'] . ')'; |
||
| 603 | } else { |
||
| 604 | $solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"'; |
||
| 605 | } |
||
| 606 | } else { |
||
| 607 | $this->error = 'noSetHierarchy'; |
||
| 608 | return null; |
||
| 609 | } |
||
| 610 | } else { |
||
| 611 | // If no set is specified we have to query for all collections |
||
| 612 | $solr_query .= 'collection:* NOT collection:""'; |
||
| 613 | } |
||
| 614 | // Check for required fields. |
||
| 615 | foreach ($this->formats[$this->parameters['metadataPrefix']]['requiredFields'] as $required) { |
||
| 616 | $solr_query .= ' NOT ' . $required . ':""'; |
||
| 617 | } |
||
| 618 | // toplevel="true" is always required |
||
| 619 | $solr_query .= ' AND toplevel:true'; |
||
| 620 | $from = "*"; |
||
| 621 | // Check "from" for valid value. |
||
| 622 | if (!empty($this->parameters['from'])) { |
||
| 623 | // Is valid format? |
||
| 624 | if ( |
||
| 625 | is_array($date_array = strptime($this->parameters['from'], '%Y-%m-%dT%H:%M:%SZ')) |
||
| 626 | || is_array($date_array = strptime($this->parameters['from'], '%Y-%m-%d')) |
||
| 627 | ) { |
||
| 628 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], |
||
| 629 | $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
||
| 630 | $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.000Z'; |
||
| 631 | } else { |
||
| 632 | $this->error = 'badArgument'; |
||
| 633 | return; |
||
| 634 | } |
||
| 635 | } |
||
| 636 | $until = "*"; |
||
| 637 | // Check "until" for valid value. |
||
| 638 | if (!empty($this->parameters['until'])) { |
||
| 639 | // Is valid format? |
||
| 640 | if ( |
||
| 641 | is_array($date_array = strptime($this->parameters['until'], '%Y-%m-%dT%H:%M:%SZ')) |
||
| 642 | || is_array($date_array = strptime($this->parameters['until'], '%Y-%m-%d')) |
||
| 643 | ) { |
||
| 644 | $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], |
||
| 645 | $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900); |
||
| 646 | $until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z'; |
||
| 647 | if ($from != "*" && $from > $until) { |
||
| 648 | $this->error = 'badArgument'; |
||
| 649 | } |
||
| 650 | } else { |
||
| 651 | $this->error = 'badArgument'; |
||
| 652 | } |
||
| 653 | } |
||
| 654 | // Check "from" and "until" for same granularity. |
||
| 655 | if ( |
||
| 656 | !empty($this->parameters['from']) |
||
| 657 | && !empty($this->parameters['until']) |
||
| 658 | ) { |
||
| 659 | if (strlen($this->parameters['from']) != strlen($this->parameters['until'])) { |
||
| 660 | $this->error = 'badArgument'; |
||
| 661 | } |
||
| 662 | } |
||
| 663 | $solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until . ']'; |
||
| 664 | $documentSet = []; |
||
| 665 | $solr = Solr::getInstance($this->settings['solrcore']); |
||
| 666 | if (!$solr->ready) { |
||
| 667 | $this->logger->error('Apache Solr not available'); |
||
| 668 | return $documentSet; |
||
| 669 | } |
||
| 670 | if (intval($this->settings['solr_limit']) > 0) { |
||
| 671 | $solr->limit = intval($this->settings['solr_limit']); |
||
| 672 | } |
||
| 673 | // We only care about the UID in the results and want them sorted |
||
| 674 | $parameters = [ |
||
| 675 | "fields" => "uid", |
||
| 676 | "sort" => [ |
||
| 677 | "uid" => "asc" |
||
| 678 | ] |
||
| 679 | ]; |
||
| 680 | $parameters['query'] = $solr_query; |
||
| 681 | $result = $solr->search_raw($parameters); |
||
| 682 | if (empty($result)) { |
||
| 683 | $this->error = 'noRecordsMatch'; |
||
| 684 | return; |
||
| 685 | } |
||
| 686 | foreach ($result as $doc) { |
||
| 687 | $documentSet[] = $doc->uid; |
||
| 688 | } |
||
| 689 | return $documentSet; |
||
| 690 | } |
||
| 691 | |||
| 692 | /** |
||
| 693 | * Fetch more information for document list |
||
| 694 | * @access protected |
||
| 695 | * |
||
| 696 | * @param array $documentListSet |
||
| 697 | * |
||
| 698 | * @return array of enriched records |
||
| 699 | */ |
||
| 700 | protected function generateOutputForDocumentList(array $documentListSet) |
||
| 742 | } |
||
| 743 | |||
| 744 | /** |
||
| 745 | * Generate resumption token |
||
| 746 | * |
||
| 747 | * @access protected |
||
| 748 | * |
||
| 749 | * @param array $documentListSet |
||
| 750 | * @param int $numShownDocuments |
||
| 751 | * |
||
| 752 | * @return void |
||
| 753 | */ |
||
| 754 | protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments) |
||
| 791 |