Constants

HEADERS_OPTION

HEADERS_OPTION = 'command.headers'

ON_COMPLETE

ON_COMPLETE = 'command.on_complete'

RESPONSE_BODY

RESPONSE_BODY = 'command.response_body'

REQUEST_OPTIONS

REQUEST_OPTIONS = 'command.request_options'

HIDDEN_PARAMS

HIDDEN_PARAMS = 'command.hidden_params'

DISABLE_VALIDATION

DISABLE_VALIDATION = 'command.disable_validation'

RESPONSE_PROCESSING

RESPONSE_PROCESSING = 'command.response_processing'

TYPE_RAW

TYPE_RAW = 'raw'

TYPE_MODEL

TYPE_MODEL = 'model'

TYPE_NO_TRANSLATION

TYPE_NO_TRANSLATION = 'no_translation'

Properties

$result

$result : mixed

Type

mixed — The result of the command

$onComplete

$onComplete : mixed

Type

mixed — callable

$data

$data : array

Type

array — Data associated with the object.

Methods

setResponseParser()

setResponseParser(\Guzzle\Service\Command\ResponseParserInterface  $parser) : self

Set the response parser used with the command

Parameters

\Guzzle\Service\Command\ResponseParserInterface $parser

Response parser

Returns

self

setRequestSerializer()

setRequestSerializer(\Guzzle\Service\Command\RequestSerializerInterface  $serializer) : self

Set the request serializer used with the command

Parameters

\Guzzle\Service\Command\RequestSerializerInterface $serializer

Request serializer

Returns

self

__construct()

__construct(array  $data = array()) 

Parameters

array $data

Associative array of data to set

__clone()

__clone() 

Custom clone behavior

__invoke()

__invoke() : mixed

Execute the command in the same manner as calling a function

Returns

mixed —

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

getName()

getName() : string

Get the short form name of the command

Returns

string

setOnComplete()

setOnComplete(mixed  $callable) : self

Specify a callable to execute when the command completes

Parameters

mixed $callable

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

Returns

self

execute()

execute() : mixed

Execute the command and return the result

Returns

mixed —

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

getClient()

getClient() : \Guzzle\Service\ClientInterface|null

Get the client object that will execute the command

Returns

\Guzzle\Service\ClientInterface|null

setClient()

setClient(\Guzzle\Service\ClientInterface  $client) : self

Set the client object that will execute the command

Parameters

\Guzzle\Service\ClientInterface $client

The client object that will execute the command

Returns

self

getResponse()

getResponse() : \Guzzle\Http\Message\Response

Get the response object associated with the command

Returns

\Guzzle\Http\Message\Response

getResult()

getResult() : \Guzzle\Http\Message\Response

Get the result of the command

Returns

\Guzzle\Http\Message\Response

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

setResult()

setResult(mixed  $result) : self

Set the result of the command

Parameters

mixed $result

Result to set

Returns

self

isPrepared()

isPrepared() : boolean

Returns TRUE if the command has been prepared for executing

Returns

boolean

isExecuted()

isExecuted() : boolean

Returns TRUE if the command has been executed

Returns

boolean

prepare()

prepare() : \Guzzle\Http\Message\RequestInterface

Prepare the command for executing and create a request object.

Returns

\Guzzle\Http\Message\RequestInterface

Returns the generated request

setValidator()

setValidator(\Guzzle\Service\Description\ValidatorInterface  $validator) : self

Set the validator used to validate and prepare command parameters and nested JSON schemas. If no validator is set, then the command will validate using the default {@see SchemaValidator}.

Parameters

\Guzzle\Service\Description\ValidatorInterface $validator

Validator used to prepare and validate properties against a JSON schema

Returns

self

getRequestHeaders()

getRequestHeaders() : \Guzzle\Common\Collection

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

Returns

\Guzzle\Common\Collection

getValidationErrors()

getValidationErrors() 

Get array of any validation errors If no validator has been set then return false

fromConfig()

fromConfig(array  $config = array(), array  $defaults = array(), array  $required = array()) : self

Create a new collection from an array, validate the keys, and add default values where missing

Parameters

array $config

Configuration values to apply.

array $defaults

Default parameters

array $required

Required parameter names

Throws

\Guzzle\Common\Exception\InvalidArgumentException

if a parameter is missing

Returns

self

count()

count() 

getIterator()

getIterator() 

toArray()

toArray() : array

Get the array representation of an object

Returns

array

getAll()

getAll(array  $keys = null) : array

Get all or a subset of matching key value pairs

Parameters

array $keys

Pass an array of keys to retrieve only a subset of key value pairs

Returns

array —

Returns an array of all matching key value pairs

get()

get(string  $key) : mixed|null

Get a specific key value.

Parameters

string $key

Key to retrieve.

Returns

mixed|null —

Value of the key or NULL

set()

set(string  $key, mixed  $value) : \Guzzle\Common\Collection

Set a key value pair

Parameters

string $key

Key to set

mixed $value

Value to set

Returns

\Guzzle\Common\Collection

Returns a reference to the object

add()

add(string  $key, mixed  $value) : \Guzzle\Common\Collection

Add a value to a key. If a key of the same name has already been added, the key value will be converted into an array and the new value will be pushed to the end of the array.

Parameters

string $key

Key to add

mixed $value

Value to add to the key

Returns

\Guzzle\Common\Collection

Returns a reference to the object.

remove()

remove(string  $key) : \Guzzle\Common\Collection

Remove a specific key value pair

Parameters

string $key

A key to remove

Returns

\Guzzle\Common\Collection

getKeys()

getKeys() : array

Get all keys in the collection

Returns

array

hasKey()

hasKey(string  $key) : boolean

Returns whether or not the specified key is present.

Parameters

string $key

The key for which to check the existence.

Returns

boolean

keySearch()

keySearch(string  $key) : boolean|string

Case insensitive search the keys in the collection

Parameters

string $key

Key to search for

Returns

boolean|string —

Returns false if not found, otherwise returns the key

hasValue()

hasValue(string  $value) : mixed

Checks if any keys contains a certain value

Parameters

string $value

Value to search for

Returns

mixed —

Returns the key if the value was found FALSE if the value was not found.

replace()

replace(array  $data) : \Guzzle\Common\Collection

Replace the data of the object with the value of an array

Parameters

array $data

Associative array of data

Returns

\Guzzle\Common\Collection

Returns a reference to the object

merge()

merge(\Guzzle\Common\Collection|array  $data) : \Guzzle\Common\Collection

Add and merge in a Collection or array of key value pair data.

Parameters

\Guzzle\Common\Collection|array $data

Associative array of key value pair data

Returns

\Guzzle\Common\Collection

Returns a reference to the object.

overwriteWith()

overwriteWith(array|\Traversable  $data) : self

Over write key value pairs in this collection with all of the data from an array or collection.

Parameters

array|\Traversable $data

Values to override over this config

Returns

self

map()

map(\Closure  $closure, array  $context = array(), boolean  $static = true) : \Guzzle\Common\Collection

Returns a Collection containing all the elements of the collection after applying the callback function to each one. The Closure should accept three parameters: (string) $key, (string) $value, (array) $context and return a modified value

Parameters

\Closure $closure

Closure to apply

array $context

Context to pass to the closure

boolean $static

Set to TRUE to use the same class as the return rather than returning a Collection

Returns

\Guzzle\Common\Collection

filter()

filter(\Closure  $closure, boolean  $static = true) : \Guzzle\Common\Collection

Iterates over each key value pair in the collection passing them to the Closure. If the Closure function returns true, the current value from input is returned into the result Collection. The Closure must accept three parameters: (string) $key, (string) $value and return Boolean TRUE or FALSE for each value.

Parameters

\Closure $closure

Closure evaluation function

boolean $static

Set to TRUE to use the same class as the return rather than returning a Collection

Returns

\Guzzle\Common\Collection

offsetExists()

offsetExists(  $offset) 

Parameters

$offset

offsetGet()

offsetGet(  $offset) 

Parameters

$offset

offsetSet()

offsetSet(  $offset,   $value) 

Parameters

$offset
$value

offsetUnset()

offsetUnset(  $offset) 

Parameters

$offset

setPath()

setPath(string  $path, mixed  $value) : self

Set a value into a nested array key. Keys will be created as needed to set the value.

Parameters

string $path

Path to set

mixed $value

Value to set at the key

Throws

\Guzzle\Common\Exception\RuntimeException

when trying to setPath using a nested path that travels through a scalar value

Returns

self

getPath()

getPath(string  $path, string  $separator = '/', mixed  $data = null) : mixed|null

Gets a value from the collection using an array path (e.g. foo/baz/bar would retrieve bar from two nested arrays) Allows for wildcard searches which recursively combine matches up to the level at which the wildcard occurs. This can be useful for accepting any key of a sub-array and combining matching keys from each diverging path.

Parameters

string $path

Path to traverse and retrieve a value from

string $separator

Character used to add depth to the search

mixed $data

Optional data to descend into (used when wildcards are encountered)

Returns

mixed|null

inject()

inject(string  $input) : string

Inject configuration settings into an input string

Parameters

string $input

Input to inject

Returns

string

createPresignedUrl()

createPresignedUrl(integer|string  $expires) : string

Create a pre-signed URL for the operation

Parameters

integer|string $expires

The Unix timestamp to expire at or a string that can be evaluated by strtotime

Returns

string

createAuthorization()

createAuthorization(  $expires) 

Parameters

$expires

build()

build() 

Create the request object that will carry out the command

process()

process() 

Create the result of the command after the request has been completed.

Override this method in subclasses to customize this behavior

init()

init() 

Initialize the command (hook that can be implemented in subclasses)

createOperation()

createOperation() : \Guzzle\Service\Description\OperationInterface

Hook used to create an operation for concrete commands that are not associated with a service description

Returns

\Guzzle\Service\Description\OperationInterface

validate()

validate() 

Validate and prepare the command based on the schema and rules defined by the command's Operation object

Throws

\Guzzle\Service\Exception\ValidationException

when validation errors occur

getValidator()

getValidator() : \Guzzle\Service\Description\ValidatorInterface

Get the validator used to prepare and validate properties. If no validator has been set on the command, then the default {@see SchemaValidator} will be used.

Returns

\Guzzle\Service\Description\ValidatorInterface