Interface Guzzle\Service\ClientInterface

ExtendsGuzzle\Common\FromConfigInterface, Guzzle\Http\ClientInterface
Implemented byGuzzle\Service\Client

Client interface for executing commands on a web service.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
addSubscriber() Add an event subscriber to the dispatcher Guzzle\Common\HasDispatcherInterface
createRequest() Create and return a new {@see RequestInterface} configured for the client. Guzzle\Http\ClientInterface
delete() Create a DELETE request for the client Guzzle\Http\ClientInterface
dispatch() Helper to dispatch Guzzle events and set the event name on the event Guzzle\Common\HasDispatcherInterface
execute() Execute one or more commands Guzzle\Service\ClientInterface
factory() Static factory method used to turn an array or collection of configuration data into an instantiated object. Guzzle\Common\FromConfigInterface
get() Create a GET request for the client Guzzle\Http\ClientInterface
getAllEvents() Get a list of all of the events emitted from the class Guzzle\Common\HasDispatcherInterface
getBaseUrl() Get the client's base URL as either an expanded or raw URI template Guzzle\Http\ClientInterface
getCommand() Get a command by name. First, the client will see if it has a service description and if the service description defines a command by the supplied name. If no dynamic command is found, the client will look for a concrete command class exists matching the name supplied. If neither are found, an InvalidArgumentException is thrown. Guzzle\Service\ClientInterface
getConfig() Get a configuration setting or all of the configuration settings. The Collection result of this method can be modified to change the configuration settings of a client. Guzzle\Http\ClientInterface
getDescription() Get the service description of the client Guzzle\Service\ClientInterface
getEventDispatcher() Get the EventDispatcher of the request Guzzle\Common\HasDispatcherInterface
getIterator() Get a resource iterator from the client. Guzzle\Service\ClientInterface
head() Create a HEAD request for the client Guzzle\Http\ClientInterface
options() Create an OPTIONS request for the client Guzzle\Http\ClientInterface
patch() Create a PATCH request for the client Guzzle\Http\ClientInterface
post() Create a POST request for the client Guzzle\Http\ClientInterface
put() Create a PUT request for the client Guzzle\Http\ClientInterface
send() Sends a single request or an array of requests in parallel Guzzle\Http\ClientInterface
setBaseUrl() Set the base URL of the client Guzzle\Http\ClientInterface
setConfig() Set the configuration object to use with the client Guzzle\Http\ClientInterface
setDescription() Set the service description of the client Guzzle\Service\ClientInterface
setEventDispatcher() Set the EventDispatcher of the request Guzzle\Common\HasDispatcherInterface
setSslVerification() Set SSL verification options. Guzzle\Http\ClientInterface
setUserAgent() Set the User-Agent header to be used on all requests from the client Guzzle\Http\ClientInterface

Method Details

execute() public abstract method

Execute one or more commands

public abstract mixed execute ( $command )
$command Guzzle\Service\Command\CommandInterface|array|\Guzzle\Service\Traversable

Command, array of commands or Traversable object containing commands to execute

return mixed

Returns the result of the executed command or an array of commands if executing multiple commands

throws Guzzle\Common\Exception\InvalidArgumentException

if an invalid command is passed

throws Guzzle\Service\Exception\CommandTransferException

if an exception is encountered when transferring multiple commands

getCommand() public abstract method

Get a command by name. First, the client will see if it has a service description and if the service description defines a command by the supplied name. If no dynamic command is found, the client will look for a concrete command class exists matching the name supplied. If neither are found, an InvalidArgumentException is thrown.

public abstract Guzzle\Service\Command\CommandInterface getCommand ( $name, array $args = [] )
$name string

Name of the command to retrieve

$args array

Arguments to pass to the command

throws Guzzle\Common\Exception\InvalidArgumentException

if no command can be found by name

getDescription() public abstract method

Get the service description of the client

public abstract Guzzle\Service\Description\ServiceDescriptionInterface|null getDescription ( )
getIterator() public abstract method

Get a resource iterator from the client.

public abstract Guzzle\Service\Resource\ResourceIteratorInterface getIterator ( $command, array $commandOptions null, array $iteratorOptions = [] )
$command string|Guzzle\Service\Command\CommandInterface

Command class or command name.

$commandOptions array

Command options used when creating commands.

$iteratorOptions array

Iterator options passed to the iterator when it is instantiated.

setDescription() public abstract method

Set the service description of the client

public abstract Guzzle\Service\ClientInterface setDescription ( Guzzle\Service\Description\ServiceDescriptionInterface $service )
$service Guzzle\Service\Description\ServiceDescriptionInterface

Service description