You are here

public function Repository::decodeResumptionToken in Views OAI-PMH 8

Decode resumption token possible properties are:

->offset ->metadataPrefix ->set ->from (timestamp) ->until (timestamp)

Parameters

string $token:

Return value

array

1 call to Repository::decodeResumptionToken()
Repository::listRecordsByToken in src/Service/Repository.php

File

src/Service/Repository.php, line 182

Class

Repository

Namespace

Drupal\views_oai_pmh\Service

Code

public function decodeResumptionToken($token) {
  $params = (array) json_decode(base64_decode($token));
  if (!empty($params['from'])) {
    $params['from'] = new \DateTime('@' . $params['from']);
  }
  if (!empty($params['until'])) {
    $params['until'] = new \DateTime('@' . $params['until']);
  }
  return $params;
}