Connector
in package
implements
LoggerAwareInterface
Uses
LoggerAwareTrait
BrowZine connector.
Tags
Interfaces, Classes, Traits and Enums
- LoggerAwareInterface
Table of Contents
- $base : string
- The base URI for API requests
- $client : Client
- The HTTP Request client used for API transactions
- $libraryId : string
- The library ID number to use
- $token : string
- The API access token
- __construct() : mixed
- Constructor
- lookupDoi() : mixed
- Perform a DOI lookup
- lookupIssns() : mixed
- Perform an ISSN lookup.
- search() : mixed
- Perform a search
- debug() : void
- Log a debug message.
- getUri() : string
- Get a full request URL for a relative path
- log() : void
- Send a message to the logger.
- logError() : void
- Log an error message.
- logWarning() : void
- Log a warning message.
- request() : mixed
- Perform an API request and return the response body
Properties
$base
The base URI for API requests
protected
string
$base
= 'https://api.thirdiron.com/public/v1/'
$client
The HTTP Request client used for API transactions
protected
Client
$client
$libraryId
The library ID number to use
protected
string
$libraryId
$token
The API access token
protected
string
$token
Methods
__construct()
Constructor
public
__construct(Client $client, string $token, string $id) : mixed
Sets up the BrowZine Client
Parameters
- $client : Client
-
HTTP client
- $token : string
-
API access token
- $id : string
-
Library ID number
Return values
mixed —lookupDoi()
Perform a DOI lookup
public
lookupDoi(string $doi[, bool $includeJournal = false ]) : mixed
Parameters
- $doi : string
-
DOI
- $includeJournal : bool = false
-
Include journal data in response?
Return values
mixed —lookupIssns()
Perform an ISSN lookup.
public
lookupIssns(string|array<string|int, mixed> $issns) : mixed
Parameters
- $issns : string|array<string|int, mixed>
-
ISSN(s) to look up.
Return values
mixed —search()
Perform a search
public
search(string $query) : mixed
Parameters
- $query : string
-
Search query
Return values
mixed —debug()
Log a debug message.
protected
debug(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
- $msg : string
-
Log message
- $context : array<string|int, mixed> = []
-
Log context
- $prependClass : bool = true
-
Prepend class name to message?
Return values
void —getUri()
Get a full request URL for a relative path
protected
getUri(string $path) : string
Parameters
- $path : string
-
URL path for service
Return values
string —log()
Send a message to the logger.
protected
log(string $level, string $message[, array<string|int, mixed> $context = [] ][, bool $prependClass = false ]) : void
Parameters
- $level : string
-
Log level
- $message : string
-
Log message
- $context : array<string|int, mixed> = []
-
Log context
- $prependClass : bool = false
-
Prepend class name to message?
Return values
void —logError()
Log an error message.
protected
logError(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
- $msg : string
-
Log message
- $context : array<string|int, mixed> = []
-
Log context
- $prependClass : bool = true
-
Prepend class name to message?
Return values
void —logWarning()
Log a warning message.
protected
logWarning(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
- $msg : string
-
Log message
- $context : array<string|int, mixed> = []
-
Log context
- $prependClass : bool = true
-
Prepend class name to message?
Return values
void —request()
Perform an API request and return the response body
protected
request(string $path[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
- $path : string
-
URL path for service
- $params : array<string|int, mixed> = []
-
GET parameters