Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • VivaPayments
      • Message
  • PHP

Classes

  • AbstractCommand
  • ClosureCommand
  • CreateResponseClassEvent
  • DefaultRequestSerializer
  • DefaultResponseParser
  • OperationCommand
  • OperationResponseParser

Interfaces

  • CommandInterface
  • RequestSerializerInterface
  • ResponseClassInterface
  • ResponseParserInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class AbstractCommand

Command object to handle preparing and processing client requests and responses of the requests

Guzzle\Common\Collection implements ArrayAccess, IteratorAggregate, Countable, Guzzle\Common\ToArrayInterface
Extended by Guzzle\Service\Command\AbstractCommand implements Guzzle\Service\Command\CommandInterface

Direct known subclasses

Guzzle\Service\Command\ClosureCommand, Guzzle\Service\Command\OperationCommand, Guzzle\Tests\Service\Mock\Command\MockCommand

Indirect known subclasses

Guzzle\Tests\Service\Mock\Command\IterableCommand, Guzzle\Tests\Service\Mock\Command\OtherCommand, Guzzle\Tests\Service\Mock\Command\Sub\Sub
Abstract
Namespace: Guzzle\Service\Command
Located at src/Guzzle/Service/Command/AbstractCommand.php
Methods summary
public
# __construct( array|Guzzle\Common\Collection $parameters = array(), Guzzle\Service\Description\OperationInterface $operation = null )

Parameters

$parameters
Collection of parameters to set on the command
$operation
Command definition from description

Overrides

Guzzle\Common\Collection::__construct()
public
# __clone( )

Custom clone behavior

Custom clone behavior

public mixed
# __invoke( )

Execute the command in the same manner as calling a function

Execute the command in the same manner as calling a function

Returns

mixed
Returns the result of AbstractCommand::execute
public string
# getName( )

Get the short form name of the command

Get the short form name of the command

Returns

string

Implementation of

Guzzle\Service\Command\CommandInterface::getName()
public Guzzle\Service\Description\OperationInterface
# getOperation( )

Get the API command information about the command

Get the API command information about the command

Returns

Guzzle\Service\Description\OperationInterface

Implementation of

Guzzle\Service\Command\CommandInterface::getOperation()
public Guzzle\Service\Command\AbstractCommand
# setOnComplete( mixed $callable )

Specify a callable to execute when the command completes

Specify a callable to execute when the command completes

Parameters

$callable

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

Returns

Guzzle\Service\Command\AbstractCommand

Throws

InvalidArgumentException

Implementation of

Guzzle\Service\Command\CommandInterface::setOnComplete()
public mixed
# execute( )

Execute the command and return the result

Execute the command and return the result

Returns

mixed
Returns the result of CommandInterface::execute

Throws

Guzzle\Service\Exception\CommandException
if a client has not been associated with the command

Implementation of

Guzzle\Service\Command\CommandInterface::execute()
public Guzzle\Service\ClientInterface|null
# getClient( )

Get the client object that will execute the command

Get the client object that will execute the command

Returns

Guzzle\Service\ClientInterface|null

Implementation of

Guzzle\Service\Command\CommandInterface::getClient()
public Guzzle\Service\Command\AbstractCommand
# setClient( Guzzle\Service\ClientInterface $client )

Set the client object that will execute the command

Set the client object that will execute the command

Parameters

$client
The client object that will execute the command

Returns

Guzzle\Service\Command\AbstractCommand

Implementation of

Guzzle\Service\Command\CommandInterface::setClient()
public Guzzle\Http\Message\RequestInterface
# getRequest( )

Get the request object associated with the command

Get the request object associated with the command

Returns

Guzzle\Http\Message\RequestInterface

Throws

Guzzle\Service\Exception\CommandException
if the command has not been executed

Implementation of

Guzzle\Service\Command\CommandInterface::getRequest()
public Response
# getResponse( )

Get the response object associated with the command

Get the response object associated with the command

Returns

Response

Throws

Guzzle\Service\Exception\CommandException
if the command has not been executed

Implementation of

Guzzle\Service\Command\CommandInterface::getResponse()
public Response
# getResult( )

Get the result of the command

Get the result of the command

Returns

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

Implementation of

Guzzle\Service\Command\CommandInterface::getResult()
public Guzzle\Service\Command\AbstractCommand
# setResult( mixed $result )

Set the result of the command

Set the result of the command

Parameters

$result
Result to set

Returns

Guzzle\Service\Command\AbstractCommand

Implementation of

Guzzle\Service\Command\CommandInterface::setResult()
public boolean
# isPrepared( )

Returns TRUE if the command has been prepared for executing

Returns TRUE if the command has been prepared for executing

Returns

boolean

Implementation of

Guzzle\Service\Command\CommandInterface::isPrepared()
public boolean
# isExecuted( )

Returns TRUE if the command has been executed

Returns TRUE if the command has been executed

Returns

boolean

Implementation of

Guzzle\Service\Command\CommandInterface::isExecuted()
public Guzzle\Http\Message\RequestInterface
# prepare( )

Prepare the command for executing and create a request object.

Prepare the command for executing and create a request object.

Returns

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()

Implementation of

Guzzle\Service\Command\CommandInterface::prepare()
public Guzzle\Service\Command\AbstractCommand
# setValidator( Guzzle\Service\Description\ValidatorInterface $validator )

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 Guzzle\Service\Description\SchemaValidator.

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 Guzzle\Service\Description\SchemaValidator.

Parameters

$validator
Validator used to prepare and validate properties against a JSON schema

Returns

Guzzle\Service\Command\AbstractCommand
public Guzzle\Common\Collection
# getRequestHeaders( )

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

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

Returns

Guzzle\Common\Collection

Implementation of

Guzzle\Service\Command\CommandInterface::getRequestHeaders()
protected
# init( )

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

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

abstract protected
# build( )

Create the request object that will carry out the command

Create the request object that will carry out the command

protected Guzzle\Service\Description\OperationInterface
# createOperation( )

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

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

Returns

Guzzle\Service\Description\OperationInterface
protected
# process( )

Create the result of the command after the request has been completed. Override this method in subclasses to customize this behavior

Create the result of the command after the request has been completed. Override this method in subclasses to customize this behavior

protected
# validate( )

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

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
protected Guzzle\Service\Description\ValidatorInterface
# getValidator( )

Get the validator used to prepare and validate properties. If no validator has been set on the command, then the default Guzzle\Service\Description\SchemaValidator will be used.

Get the validator used to prepare and validate properties. If no validator has been set on the command, then the default Guzzle\Service\Description\SchemaValidator will be used.

Returns

Guzzle\Service\Description\ValidatorInterface
public
# getValidationErrors( )

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

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

Methods inherited from Guzzle\Common\Collection
add(), clear(), count(), filter(), fromConfig(), get(), getAll(), getIterator(), getKeys(), getPath(), hasKey(), hasValue(), inject(), keySearch(), map(), merge(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), overwriteWith(), remove(), replace(), set(), setPath(), toArray()
Constants summary
string HEADERS_OPTION
# 'command.headers'
string ON_COMPLETE
# 'command.on_complete'
string RESPONSE_BODY
# 'command.response_body'
string REQUEST_OPTIONS
# 'command.request_options'
string HIDDEN_PARAMS
# 'command.hidden_params'
string DISABLE_VALIDATION
# 'command.disable_validation'
string RESPONSE_PROCESSING
# 'command.response_processing'
string TYPE_RAW
# 'raw'
string TYPE_MODEL
# 'model'
string TYPE_NO_TRANSLATION
# 'no_translation'
Properties summary
protected Guzzle\Service\ClientInterface $client

Client object used to execute the command

Client object used to execute the command

#
protected Guzzle\Http\Message\RequestInterface $request

The request object associated with the command

The request object associated with the command

#
protected mixed $result

The result of the command

The result of the command

#
protected Guzzle\Service\Description\OperationInterface $operation

API information about the command

API information about the command

#
protected mixed $onComplete

callable

callable

#
protected Guzzle\Service\Description\ValidatorInterface $validator

Validator used to prepare and validate properties against a JSON schema

Validator used to prepare and validate properties against a JSON schema

#
Properties inherited from Guzzle\Common\Collection
$data
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen