Bristol SU Support Package
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
BristolSU\Support\Connection\Contracts\Connector Class Reference

Public Member Functions

 __construct (Client $client)
 
 request ($method, $uri, array $options=[])
 
 test ()
 
 setSettings (array $settings=[])
 
 getSetting (string $key, $default=null)
 

Static Public Member Functions

static settingsSchema ()
 

Protected Attributes

 $client
 
 $settings = []
 

Detailed Description

Represents a third party connector

Definition at line 12 of file Connector.php.

Constructor & Destructor Documentation

◆ __construct()

BristolSU\Support\Connection\Contracts\Connector::__construct ( Client  $client)

Member Function Documentation

◆ getSetting()

BristolSU\Support\Connection\Contracts\Connector::getSetting ( string  $key,
  $default = null 
)

Get a setting value

Parameters
string$keyKey of the setting
null$defaultDefault value if the setting is not found. Defaults to null
Returns
mixed

Definition at line 81 of file Connector.php.

References function\settings().

◆ request()

BristolSU\Support\Connection\Contracts\Connector::request (   $method,
  $uri,
array  $options = [] 
)
abstract

Prepare and send a request.

You may add authentication, default fields or anything else here. Call $this->client->request and return the result when prepared.

Parameters
string$methodMethod to use for the request
string$uriURI to use for the request
array$optionsOptions to use for the request. See Guzzle options for more information
Returns
ResponseInterface

Referenced by BristolSU\Support\Connection\Contracts\Connector\__construct().

◆ setSettings()

BristolSU\Support\Connection\Contracts\Connector::setSettings ( array  $settings = [])

Set the settings on the connector

Parameters
array$settingsSettings for the connector

Definition at line 69 of file Connector.php.

References BristolSU\Support\Connection\Contracts\Connector\$settings, and function\settings().

Referenced by BristolSU\Support\Connection\ConnectorFactory\createFromConnection().

◆ settingsSchema()

static BristolSU\Support\Connection\Contracts\Connector::settingsSchema ( )
staticabstract

Get the settings schema to use

Returns
Form Setting schema representation

Referenced by BristolSU\Support\Connection\Contracts\Connector\__construct().

◆ test()

BristolSU\Support\Connection\Contracts\Connector::test ( )
abstract

Check the connection is still connected

Returns
bool

Referenced by BristolSU\Support\Connection\Contracts\Connector\__construct().

Member Data Documentation

◆ $client

BristolSU\Support\Connection\Contracts\Connector::$client
protected

◆ $settings

BristolSU\Support\Connection\Contracts\Connector::$settings = []
protected

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