$eventDispatcher
$eventDispatcher : \Symfony\Component\EventDispatcher\EventDispatcherInterface
Class that holds an event dispatcher
Clients and data can be set, retrieved, and removed by accessing the service builder like an associative array.
$eventDispatcher : \Symfony\Component\EventDispatcher\EventDispatcherInterface
$cachedFactory : \Guzzle\Service\Builder\ServiceBuilderLoader
setEventDispatcher(\Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher) : self
Set the EventDispatcher of the request
\Symfony\Component\EventDispatcher\EventDispatcherInterface | $eventDispatcher |
getEventDispatcher() : \Symfony\Component\EventDispatcher\EventDispatcherInterface
Get the EventDispatcher of the request
dispatch(string $eventName, array $context = array()) : \Guzzle\Common\Event
Helper to dispatch Guzzle events and set the event name on the event
string | $eventName | Name of the event to dispatch |
array | $context | Context of the event |
Returns the created event object
addSubscriber(\Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber) : self
Add an event subscriber to the dispatcher
\Symfony\Component\EventDispatcher\EventSubscriberInterface | $subscriber | Event subscriber |
factory(array|string $config = null, array $globalParameters = array()) : \Guzzle\Service\Builder\ServiceBuilderInterface
Create a new ServiceBuilder using configuration data sourced from an array, .js|.json or .php file.
array|string | $config | The full path to an .json|.js or .php file, or an associative array |
array | $globalParameters | Array of global parameters to pass to every service as it is instantiated. |
if a file cannot be opened
when trying to extend a missing client
addGlobalPlugin(\Symfony\Component\EventDispatcher\EventSubscriberInterface $plugin) : self
Attach a plugin to every client created by the builder
\Symfony\Component\EventDispatcher\EventSubscriberInterface | $plugin | Plugin to attach to each client |
get(string $name, boolean|array $throwAway = false) : \Guzzle\Service\ClientInterface|mixed
Get a ClientInterface object or arbitrary data from the service builder
string | $name | Name of the registered service or data to retrieve |
boolean|array | $throwAway | 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. |
set(string $key, mixed $service) : \Guzzle\Service\Builder\ServiceBuilderInterface
Register a service or arbitrary data by name with the service builder
string | $key | Name of the client or data to register |
mixed | $service | Client configuration array or arbitrary data to register. The client configuration array must include a 'class' (string) and 'params' (array) key. |