Skip to content
Snippets Groups Projects
Commit 4777b3d6 authored by Demian Katz's avatar Demian Katz
Browse files

More simplification.

parent c0e89167
No related merge requests found
...@@ -269,7 +269,7 @@ class Backend extends AbstractBackend ...@@ -269,7 +269,7 @@ class Backend extends AbstractBackend
{ {
try { try {
$authenticationToken = $this->getAuthenticationToken(); $authenticationToken = $this->getAuthenticationToken();
//check to see if the profile is overriden // check to see if the profile is overriden
$overrideProfile = $params->get('profile'); $overrideProfile = $params->get('profile');
if (isset($overrideProfile)) { if (isset($overrideProfile)) {
$this->profile = $overrideProfile; $this->profile = $overrideProfile;
...@@ -281,29 +281,21 @@ class Backend extends AbstractBackend ...@@ -281,29 +281,21 @@ class Backend extends AbstractBackend
'Retrieval id is not in the correct format.' 'Retrieval id is not in the correct format.'
); );
} }
$dbId = $parts[0]; list($dbId, $an) = $parts;
$an = $parts[1]; $hlTerms = (null != $params)
$highlightTerms = null; ? $params->get('highlightterms') : null;
if (null != $params) {
$highlightTerms = $params->get('highlightterms');
}
$response = $this->client->retrieve( $response = $this->client->retrieve(
$an, $dbId, $authenticationToken, $sessionToken, $highlightTerms $an, $dbId, $authenticationToken, $sessionToken, $hlTerms
); );
} catch (\EbscoEdsApiException $e) { } catch (\EbscoEdsApiException $e) {
if ($e->getApiErrorCode() == 104) { if ($e->getApiErrorCode() == 104) {
try { try {
$authenticationToken = $this->getAuthenticationToken(true); $authenticationToken = $this->getAuthenticationToken(true);
$response = $this->client->retrieve( $response = $this->client->retrieve(
$an, $dbId, $authenticationToken, $an, $dbId, $authenticationToken, $sessionToken, $hlTerms
$sessionToken, $highlightTerms
); );
} catch(Exception $e) { } catch(Exception $e) {
throw new BackendException( throw new BackendException($e->getMessage(), $e->getCode(), $e);
$e->getMessage(),
$e->getCode(),
$e
);
} }
} else { } else {
throw $e; throw $e;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment