Documentation

CommandInterface extends ArrayAccess, ToArrayInterface

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

Table of Contents

Methods

execute()  : mixed
Execute the command and return the result
getClient()  : ClientInterface|null
Get the client object that will execute the command
getName()  : string
Get the short form name of the command
getOperation()  : OperationInterface
Get the API operation information about the command
getRequest()  : RequestInterface
Get the request object associated with the command
getRequestHeaders()  : Collection
Get the object that manages the request headers that will be set on any outbound requests from the command
getResponse()  : Response
Get the response object associated with the command
getResult()  : Response
Get the result of the command
isExecuted()  : bool
Returns TRUE if the command has been executed
isPrepared()  : bool
Returns TRUE if the command has been prepared for executing
prepare()  : RequestInterface
Prepare the command for executing and create a request object.
setClient()  : self
Set the client object that will execute the command
setOnComplete()  : self
Specify a callable to execute when the command completes
setResult()  : self
Set the result of the command
toArray()  : array<string|int, mixed>
Get the array representation of an object

Methods

execute()

Execute the command and return the result

public execute() : mixed
Tags
throws
CommandException

if a client has not been associated with the command

Return values
mixed

Returns the result of CommandInterface::execute

getName()

Get the short form name of the command

public getName() : string
Return values
string

getRequestHeaders()

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

public getRequestHeaders() : Collection
Return values
Collection

getResult()

Get the result of the command

public getResult() : Response
Tags
throws
CommandException

if the command has not been executed

Return values
Response

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

isExecuted()

Returns TRUE if the command has been executed

public isExecuted() : bool
Return values
bool

isPrepared()

Returns TRUE if the command has been prepared for executing

public isPrepared() : bool
Return values
bool

setOnComplete()

Specify a callable to execute when the command completes

public setOnComplete(mixed $callable) : self
Parameters
$callable : mixed

Callable to execute when the command completes. The callable must accept a CommandInterface object as the only argument.

Tags
throws
InvalidArgumentException
Return values
self

setResult()

Set the result of the command

public setResult(mixed $result) : self
Parameters
$result : mixed

Result to set

Return values
self

toArray()

Get the array representation of an object

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results