PHP GBIF
PHP GBIF client
Gbif Class Reference

Inherited by Occurrences, and Species.

Public Member Functions

 __construct ()
 

Data Fields

const GBIF_BASEURL = 'https://api.gbif.org/v1/'
 

Protected Member Functions

 gbifGet ($uri, array $args=[])
 
 formatQueryString (array $args)
 
 bool2str (bool $val)
 

Protected Attributes

 $gbifClient
 

Detailed Description

GBIF: generic class.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Constructs a GBIF object.

Member Function Documentation

◆ bool2str()

bool2str ( bool  $val)
protected

Represents boolean value as literal.

Parameters
bool$valBoolean value to convert.
Returns
string Literal representation ('true' or 'false').

◆ formatQueryString()

formatQueryString ( array  $args)
protected

Formats a query string.

Guzzle cannot deal with duplicate URI parameters by default, so we directly pass a string instead of an array.

Parameters
array$argsArguments to be passed through the query string.
Returns
string Formatted query string.

◆ gbifGet()

gbifGet (   $uri,
array  $args = [] 
)
protected

Sends an HTTP GET request to GBIF.

Parameters
string$uriURI without base URI and leading slash.
array$argsArguments to be passed through the query string.
Returns
array An array of results.
Exceptions

ResTelae\Gbif\GbifException In case the HTTP request ends with an error.

Field Documentation

◆ GBIF_BASEURL

const GBIF_BASEURL = 'https://api.gbif.org/v1/'

GBIF API base URL.


The documentation for this class was generated from the following file: