You are here

private function Repository::encodeResumptionToken in Views OAI-PMH 8

Get resumption token

Parameters

int $offset:

DateTime $from:

DateTime $util:

string $metadataPrefix:

string $set:

Return value

string

2 calls to Repository::encodeResumptionToken()
Repository::listRecords in src/Service/Repository.php
Repository::listRecordsByToken in src/Service/Repository.php

File

src/Service/Repository.php, line 138

Class

Repository

Namespace

Drupal\views_oai_pmh\Service

Code

private function encodeResumptionToken($offset = 0, \DateTime $from = null, \DateTime $util = null, $metadataPrefix = null, $set = null) {
  $params = [];
  $params['offset'] = $offset;
  $params['metadataPrefix'] = $metadataPrefix;
  $params['set'] = $set;
  $params['from'] = null;
  $params['until'] = null;
  if ($from) {
    $params['from'] = $from
      ->getTimestamp();
  }
  if ($util) {
    $params['until'] = $util
      ->getTimestamp();
  }
  return base64_encode(json_encode($params));
}