ConnectorInterface
in
Primo Central connector interface.
Tags
Table of Contents
- getInstitutionCode() : string
- Get the institution code based on user IP. If user is coming from off campus return
- getRecord() : array<string|int, mixed>
- Retrieves a document specified by the ID.
- query() : array<string|int, mixed>
- Execute a search. Adds all the querystring parameters into $this->client and returns the parsed response
Methods
getInstitutionCode()
Get the institution code based on user IP. If user is coming from off campus return
public
getInstitutionCode() : string
Return values
string —getRecord()
Retrieves a document specified by the ID.
public
getRecord(string $recordId[, string|null $inst_code = null ][, bool $onCampus = false ]) : array<string|int, mixed>
Parameters
- $recordId : string
-
The document to retrieve from the Primo API
- $inst_code : string|null = null
-
Institution code (optional)
- $onCampus : bool = false
-
Whether the user is on campus
Tags
Return values
array<string|int, mixed> —An array of query results
query()
Execute a search. Adds all the querystring parameters into $this->client and returns the parsed response
public
query(string $institution, array<string|int, mixed> $terms[, array<string|int, mixed> $params = null ]) : array<string|int, mixed>
Parameters
- $institution : string
-
Institution
- $terms : array<string|int, mixed>
-
Associative array: index string: primo index to search (default "any") lookfor string: actual search terms
- $params : array<string|int, mixed> = null
-
Associative array of optional arguments: phrase bool: true if it's a quoted phrase (default false) onCampus bool: (default true) didyoumean bool: (default false) filterList array: (field, value) pairs to filter results (def null) pageNumber string: index of first record (default 1) limit string: number of records to return (default 20) sort string: value to be used by for sorting (default null) highlight bool: whether to highlight search term matches in records highlightStart string: Prefix for a highlighted term highlightEnd string: Suffix for a Highlighted term Anything in $params not listed here will be ignored.
Note: some input parameters accepted by Primo are not implemented here:
- dym (did you mean)
- more (get more)
- lang (specify input language so engine can do lang. recognition)
- displayField (has to do with highlighting somehow)
Tags
Return values
array<string|int, mixed> —An array of query results