Open Journal Systems  3.3.0
Guzzle\Service\Builder\ServiceBuilderInterface Interface Reference
Inheritance diagram for Guzzle\Service\Builder\ServiceBuilderInterface:
Guzzle\Service\Builder\ServiceBuilder

Public Member Functions

 get ($name, $throwAway=false)
 
 set ($key, $service)
 

Detailed Description

Service builder used to store and build clients or arbitrary data. Client configuration data can be supplied to tell the service builder how to create and cache {

See also
\Guzzle\Service\ClientInterface} objects. Arbitrary data can be supplied and accessed from a service builder. Arbitrary data and other clients can be referenced by name in client configuration arrays to make them input for building other clients (e.g. "{key}").

Definition at line 13 of file ServiceBuilderInterface.php.

Member Function Documentation

◆ get()

Guzzle\Service\Builder\ServiceBuilderInterface::get (   $name,
  $throwAway = false 
)

Get a ClientInterface object or arbitrary data from the service builder

Parameters
string$nameName of the registered service or data to retrieve
bool | array$throwAwayOnly pertains to retrieving client objects built using a configuration array. Set to TRUE to not store the client for later retrieval from the ServiceBuilder. If an array is specified, that data will overwrite the configured params of the client if the client implements {
See also
\Guzzle\Common\FromConfigInterface} and will not store the client for later retrieval.
Returns
\Guzzle\Service\ClientInterface|mixed
Exceptions
ServiceNotFoundExceptionwhen a client or data cannot be found by the given name

Implemented in Guzzle\Service\Builder\ServiceBuilder.

◆ set()

Guzzle\Service\Builder\ServiceBuilderInterface::set (   $key,
  $service 
)

Register a service or arbitrary data by name with the service builder

Parameters
string$keyName of the client or data to register
mixed$serviceClient configuration array or arbitrary data to register. The client configuration array must include a 'class' (string) and 'params' (array) key.
Returns
ServiceBuilderInterface

Implemented in Guzzle\Service\Builder\ServiceBuilder.


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