Interface Guzzle\Service\Builder\ServiceBuilderInterface

Implemented byGuzzle\Service\Builder\ServiceBuilder

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 \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}").

Public Methods

Hide inherited methods

MethodDescriptionDefined By
get() Get a ClientInterface object or arbitrary data from the service builder Guzzle\Service\Builder\ServiceBuilderInterface
set() Register a service or arbitrary data by name with the service builder Guzzle\Service\Builder\ServiceBuilderInterface

Method Details

get() public abstract method

Get a ClientInterface object or arbitrary data from the service builder

public abstract Guzzle\Service\ClientInterface|mixed get ( $name, $throwAway false )
$name string

Name of the registered service or data to retrieve

$throwAway bool|array

Only 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 \Guzzle\Common\FromConfigInterface} and will
                         not store the client for later retrieval.
throws Guzzle\Service\Exception\ServiceNotFoundException

when a client or data cannot be found by the given name

set() public abstract method

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

public abstract Guzzle\Service\Builder\ServiceBuilderInterface set ( $key, $service )
$key string

Name of the client or data to register

$service mixed

Client configuration array or arbitrary data to register. The client configuration array

                   must include a 'class' (string) and 'params' (array) key.