Class Guzzle\Service\Builder\ServiceBuilder

InheritanceGuzzle\Service\Builder\ServiceBuilder » Guzzle\Common\AbstractHasDispatcher
ImplementsArrayAccess, Guzzle\Common\HasDispatcherInterface, Guzzle\Service\Builder\ServiceBuilderInterface, Serializable


Clients and data can be set, retrieved, and removed by accessing the service builder like an associative array.

Property Details

$builderConfig protected property

Service builder configuration data

protected array $builderConfig = []
$cachedFactory protected static property

Cached instance of the service builder loader

$clients protected property

Instantiated client objects

protected array $clients = []
$plugins protected property

Plugins to attach to each client created by the service builder

protected array $plugins = []

Method Details

__construct() public method

public void __construct ( array $serviceBuilderConfig = [] )
$serviceBuilderConfig array

Service configuration settings:

- name: Name of the service
- class: Client class to instantiate using a factory method
- params: array of key value pair configuration settings for the builder
addGlobalPlugin() public method

Attach a plugin to every client created by the builder

public self addGlobalPlugin ( Symfony\Component\EventDispatcher\EventSubscriberInterface $plugin )
$plugin Symfony\Component\EventDispatcher\EventSubscriberInterface

Plugin to attach to each client

factory() public static method

Create a new ServiceBuilder using configuration data sourced from an array, .js|.json or .php file.

public static Guzzle\Service\Builder\ServiceBuilderInterface factory ( $config null, array $globalParameters = [] )
$config array|string

The full path to an .json|.js or .php file, or an associative array

$globalParameters array

Array of global parameters to pass to every service as it is instantiated.

throws Guzzle\Service\Exception\ServiceBuilderException

if a file cannot be opened

throws Guzzle\Service\Exception\ServiceNotFoundException

when trying to extend a missing client

get() public method

public void get ( $name, $throwAway false )
getAllEvents() public static method

public static void getAllEvents ( )
getData() public method

Get data from the service builder without triggering the building of a service

public array|null getData ( $name )
$name string

Name of the service to retrieve

offsetExists() public method

public void offsetExists ( $offset )
offsetGet() public method

public void offsetGet ( $offset )
offsetSet() public method

public void offsetSet ( $offset, $value )
offsetUnset() public method

public void offsetUnset ( $offset )
serialize() public method

public void serialize ( )
set() public method

public void set ( $key, $service )
unserialize() public method

public void unserialize ( $serialized )