Interface Guzzle\Service\Command\CommandInterface

ExtendsArrayAccess, Guzzle\Common\ToArrayInterface
Implemented byGuzzle\Service\Command\AbstractCommand, Guzzle\Service\Command\ClosureCommand, Guzzle\Service\Command\OperationCommand

A command object that contains parameters that can be modified and accessed like an array and turned into an array

Public Methods

Hide inherited methods

MethodDescriptionDefined By
execute() Execute the command and return the result Guzzle\Service\Command\CommandInterface
getClient() Get the client object that will execute the command Guzzle\Service\Command\CommandInterface
getName() Get the short form name of the command Guzzle\Service\Command\CommandInterface
getOperation() Get the API operation information about the command Guzzle\Service\Command\CommandInterface
getRequest() Get the request object associated with the command Guzzle\Service\Command\CommandInterface
getRequestHeaders() Get the object that manages the request headers that will be set on any outbound requests from the command Guzzle\Service\Command\CommandInterface
getResponse() Get the response object associated with the command Guzzle\Service\Command\CommandInterface
getResult() Get the result of the command Guzzle\Service\Command\CommandInterface
isExecuted() Returns TRUE if the command has been executed Guzzle\Service\Command\CommandInterface
isPrepared() Returns TRUE if the command has been prepared for executing Guzzle\Service\Command\CommandInterface
prepare() Prepare the command for executing and create a request object. Guzzle\Service\Command\CommandInterface
setClient() Set the client object that will execute the command Guzzle\Service\Command\CommandInterface
setOnComplete() Specify a callable to execute when the command completes Guzzle\Service\Command\CommandInterface
setResult() Set the result of the command Guzzle\Service\Command\CommandInterface
toArray() Get the array representation of an object Guzzle\Common\ToArrayInterface

Method Details

execute() public abstract method

Execute the command and return the result

public abstract mixed execute ( )
return mixed

Returns the result of {@see CommandInterface::execute}

throws Guzzle\Service\Exception\CommandException

if a client has not been associated with the command

getClient() public abstract method

Get the client object that will execute the command

public abstract Guzzle\Service\ClientInterface|null getClient ( )
getName() public abstract method

Get the short form name of the command

public abstract string getName ( )
getOperation() public abstract method

Get the API operation information about the command

public abstract Guzzle\Service\Description\OperationInterface getOperation ( )
getRequest() public abstract method

Get the request object associated with the command

public abstract Guzzle\Http\Message\RequestInterface getRequest ( )
throws Guzzle\Service\Exception\CommandException

if the command has not been executed

getRequestHeaders() public abstract method

Get the object that manages the request headers that will be set on any outbound requests from the command

public abstract Guzzle\Common\Collection getRequestHeaders ( )
getResponse() public abstract method

Get the response object associated with the command

public abstract Guzzle\Http\Message\Response getResponse ( )
throws Guzzle\Service\Exception\CommandException

if the command has not been executed

getResult() public abstract method

Get the result of the command

public abstract Guzzle\Http\Message\Response getResult ( )
return Guzzle\Http\Message\Response

By default, commands return a Response object unless overridden in a subclass

throws Guzzle\Service\Exception\CommandException

if the command has not been executed

isExecuted() public abstract method

Returns TRUE if the command has been executed

public abstract bool isExecuted ( )
isPrepared() public abstract method

Returns TRUE if the command has been prepared for executing

public abstract bool isPrepared ( )
prepare() public abstract method

Prepare the command for executing and create a request object.

public abstract Guzzle\Http\Message\RequestInterface prepare ( )
return Guzzle\Http\Message\RequestInterface

Returns the generated request

throws Guzzle\Service\Exception\CommandException

if a client object has not been set previously or in the prepare()

setClient() public abstract method

Set the client object that will execute the command

public abstract self setClient ( Guzzle\Service\ClientInterface $client )
$client Guzzle\Service\ClientInterface

The client object that will execute the command

setOnComplete() public abstract method

Specify a callable to execute when the command completes

public abstract self setOnComplete ( $callable )
$callable mixed

Callable to execute when the command completes. The callable must accept a

                   {@see CommandInterface} object as the only argument.
throws Guzzle\Common\Exception\InvalidArgumentException
setResult() public abstract method

Set the result of the command

public abstract self setResult ( $result )
$result mixed

Result to set