Open Journal Systems
3.3.0
|
Public Member Functions | |
__clone () | |
__construct ($parameters=array(), OperationInterface $operation=null) | |
__invoke () | |
execute () | |
getClient () | |
getName () | |
getOperation () | |
getRequest () | |
getRequestHeaders () | |
getResponse () | |
getResult () | |
getValidationErrors () | |
isExecuted () | |
isPrepared () | |
prepare () | |
setClient (ClientInterface $client) | |
setOnComplete ($callable) | |
setResult ($result) | |
setValidator (ValidatorInterface $validator) | |
![]() | |
__construct (array $data=array()) | |
add ($key, $value) | |
clear () | |
count () | |
filter (\Closure $closure, $static=true) | |
get ($key) | |
getAll (array $keys=null) | |
getIterator () | |
getKeys () | |
getPath ($path, $separator='/', $data=null) | |
hasKey ($key) | |
hasValue ($value) | |
inject ($input) | |
keySearch ($key) | |
map (\Closure $closure, array $context=array(), $static=true) | |
merge ($data) | |
offsetExists ($offset) | |
offsetGet ($offset) | |
offsetSet ($offset, $value) | |
offsetUnset ($offset) | |
overwriteWith ($data) | |
remove ($key) | |
replace (array $data) | |
set ($key, $value) | |
setPath ($path, $value) | |
toArray () | |
Data Fields | |
const | DISABLE_VALIDATION = 'command.disable_validation' |
const | HEADERS_OPTION = 'command.headers' |
const | HIDDEN_PARAMS = 'command.hidden_params' |
const | ON_COMPLETE = 'command.on_complete' |
const | REQUEST_OPTIONS = 'command.request_options' |
const | RESPONSE_BODY = 'command.response_body' |
const | RESPONSE_PROCESSING = 'command.response_processing' |
const | TYPE_MODEL = 'model' |
const | TYPE_NO_TRANSLATION = 'no_translation' |
const | TYPE_RAW = 'raw' |
Protected Member Functions | |
build () | |
createOperation () | |
getValidator () | |
init () | |
process () | |
validate () | |
Protected Attributes | |
$client | |
$onComplete | |
$operation | |
$request | |
$result | |
$validator | |
![]() | |
$data | |
Additional Inherited Members | |
![]() | |
static | fromConfig (array $config=array(), array $defaults=array(), array $required=array()) |
Command object to handle preparing and processing client requests and responses of the requests
Definition at line 21 of file AbstractCommand.php.
Guzzle\Service\Command\AbstractCommand::__construct | ( | $parameters = array() , |
|
OperationInterface | $operation = null |
||
) |
array | Collection | $parameters | Collection of parameters to set on the command |
OperationInterface | $operation | Command definition from description |
Definition at line 83 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$onComplete, Guzzle\Service\Command\AbstractCommand\$operation, Guzzle\Service\Command\AbstractCommand\createOperation(), Guzzle\Service\Command\AbstractCommand\HEADERS_OPTION, Guzzle\Service\Command\AbstractCommand\HIDDEN_PARAMS, Guzzle\Service\Command\AbstractCommand\init(), and Guzzle\Service\Command\AbstractCommand\setOnComplete().
Guzzle\Service\Command\AbstractCommand::__clone | ( | ) |
Custom clone behavior
Definition at line 123 of file AbstractCommand.php.
Guzzle\Service\Command\AbstractCommand::__invoke | ( | ) |
Execute the command in the same manner as calling a function
Definition at line 134 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\execute().
|
abstractprotected |
Create the request object that will carry out the command
Reimplemented in Guzzle\Service\Command\OperationCommand, Guzzle\Service\Command\ClosureCommand, Guzzle\Tests\Service\Mock\Command\MockCommand, Guzzle\Tests\Service\Mock\Command\OtherCommand, and Guzzle\Tests\Service\Mock\Command\IterableCommand.
Referenced by Guzzle\Service\Command\AbstractCommand\prepare().
|
protected |
Hook used to create an operation for concrete commands that are not associated with a service description
Reimplemented in Guzzle\Tests\Service\Mock\Command\IterableCommand, Guzzle\Tests\Service\Mock\Command\MockCommand, and Guzzle\Tests\Service\Mock\Command\OtherCommand.
Definition at line 316 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\__construct().
Guzzle\Service\Command\AbstractCommand::execute | ( | ) |
Execute the command and return the result
CommandException | if a client has not been associated with the command |
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 165 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\__invoke(), Guzzle\Service\Command\AbstractCommand\getResponse(), and Guzzle\Service\Command\AbstractCommand\getResult().
Guzzle\Service\Command\AbstractCommand::getClient | ( | ) |
Get the client object that will execute the command
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 174 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$client.
Guzzle\Service\Command\AbstractCommand::getName | ( | ) |
Get the short form name of the command
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 139 of file AbstractCommand.php.
Guzzle\Service\Command\AbstractCommand::getOperation | ( | ) |
Get the API command information about the command
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 149 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$operation.
Guzzle\Service\Command\AbstractCommand::getRequest | ( | ) |
Get the request object associated with the command
CommandException | if the command has not been executed |
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 186 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$request.
Guzzle\Service\Command\AbstractCommand::getRequestHeaders | ( | ) |
Get the object that manages the request headers that will be set on any outbound requests from the command
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 296 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\HEADERS_OPTION.
Guzzle\Service\Command\AbstractCommand::getResponse | ( | ) |
Get the response object associated with the command
CommandException | if the command has not been executed |
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 195 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\execute(), and Guzzle\Service\Command\AbstractCommand\isExecuted().
Guzzle\Service\Command\AbstractCommand::getResult | ( | ) |
Get the result of the command
CommandException | if the command has not been executed |
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 204 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$result, Guzzle\Service\Command\AbstractCommand\execute(), Guzzle\Service\Command\AbstractCommand\isExecuted(), and Guzzle\Service\Command\AbstractCommand\process().
Guzzle\Service\Command\AbstractCommand::getValidationErrors | ( | ) |
Get array of any validation errors If no validator has been set then return false
Definition at line 400 of file AbstractCommand.php.
|
protected |
Get the validator used to prepare and validate properties. If no validator has been set on the command, then the default {
Definition at line 387 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$validator, and Guzzle\Service\Description\SchemaValidator\getInstance().
Referenced by Guzzle\Service\Command\AbstractCommand\validate().
|
protected |
Initialize the command (hook that can be implemented in subclasses)
Reimplemented in Guzzle\Service\Command\ClosureCommand.
Definition at line 304 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\__construct().
Guzzle\Service\Command\AbstractCommand::isExecuted | ( | ) |
Returns TRUE if the command has been executed
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 233 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\getResponse(), and Guzzle\Service\Command\AbstractCommand\getResult().
Guzzle\Service\Command\AbstractCommand::isPrepared | ( | ) |
Returns TRUE if the command has been prepared for executing
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 228 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\prepare().
Guzzle\Service\Command\AbstractCommand::prepare | ( | ) |
Prepare the command for executing and create a request object.
CommandException | if a client object has not been set previously or in the prepare() |
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 238 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$request, Guzzle\Service\Command\AbstractCommand\build(), Guzzle\Http\Client\CURL_OPTIONS, Guzzle\Service\Command\AbstractCommand\isPrepared(), Guzzle\Http\Curl\CurlHandle\parseCurlConfig(), Guzzle\Service\Command\AbstractCommand\RESPONSE_PROCESSING, Guzzle\Service\Command\AbstractCommand\TYPE_MODEL, and Guzzle\Service\Command\AbstractCommand\validate().
|
protected |
Create the result of the command after the request has been completed. Override this method in subclasses to customize this behavior
Reimplemented in Guzzle\Service\Command\OperationCommand.
Definition at line 325 of file AbstractCommand.php.
References Guzzle\Service\Command\DefaultResponseParser\getInstance(), and Guzzle\Service\Command\AbstractCommand\RESPONSE_PROCESSING.
Referenced by Guzzle\Service\Command\AbstractCommand\getResult().
Guzzle\Service\Command\AbstractCommand::setClient | ( | ClientInterface | $client | ) |
Set the client object that will execute the command
ClientInterface | $client | The client object that will execute the command |
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 179 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$client.
Guzzle\Service\Command\AbstractCommand::setOnComplete | ( | $callable | ) |
Specify a callable to execute when the command completes
mixed | $callable | Callable to execute when the command completes. The callable must accept a { |
InvalidArgumentException |
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 154 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\__construct().
Guzzle\Service\Command\AbstractCommand::setResult | ( | $result | ) |
Set the result of the command
mixed | $result | Result to set |
Implements Guzzle\Service\Command\CommandInterface.
Definition at line 221 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$result.
Guzzle\Service\Command\AbstractCommand::setValidator | ( | 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 {
ValidatorInterface | $validator | Validator used to prepare and validate properties against a JSON schema |
Definition at line 289 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$validator.
|
protected |
Validate and prepare the command based on the schema and rules defined by the command's Operation object
ValidationException | when validation errors occur |
Definition at line 337 of file AbstractCommand.php.
References Guzzle\Service\Command\AbstractCommand\$validator, Guzzle\Service\Command\AbstractCommand\getValidator(), Guzzle\Service\Command\AbstractCommand\HIDDEN_PARAMS, and Guzzle\Common\Collection\toArray().
Referenced by Guzzle\Service\Command\AbstractCommand\prepare().
|
protected |
Client object used to execute the command
Definition at line 47 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\getClient(), and Guzzle\Service\Command\AbstractCommand\setClient().
|
protected |
callable
Definition at line 71 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\__construct().
|
protected |
API information about the command
Definition at line 65 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\__construct(), and Guzzle\Service\Command\AbstractCommand\getOperation().
|
protected |
The request object associated with the command
Definition at line 53 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\getRequest(), and Guzzle\Service\Command\AbstractCommand\prepare().
|
protected |
The result of the command
Definition at line 59 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\getResult(), and Guzzle\Service\Command\AbstractCommand\setResult().
|
protected |
Validator used to prepare and validate properties against a JSON schema
Definition at line 77 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\getValidator(), Guzzle\Service\Command\AbstractCommand\setValidator(), and Guzzle\Service\Command\AbstractCommand\validate().
const Guzzle\Service\Command\AbstractCommand::DISABLE_VALIDATION = 'command.disable_validation' |
Definition at line 35 of file AbstractCommand.php.
Referenced by Guzzle\Tests\Service\Command\CommandTest\testCanDisableValidation().
const Guzzle\Service\Command\AbstractCommand::HEADERS_OPTION = 'command.headers' |
const Guzzle\Service\Command\AbstractCommand::HIDDEN_PARAMS = 'command.hidden_params' |
Definition at line 33 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\AbstractCommand\__construct(), and Guzzle\Service\Command\AbstractCommand\validate().
const Guzzle\Service\Command\AbstractCommand::ON_COMPLETE = 'command.on_complete' |
Definition at line 26 of file AbstractCommand.php.
const Guzzle\Service\Command\AbstractCommand::REQUEST_OPTIONS = 'command.request_options' |
Definition at line 31 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\DefaultRequestSerializer\createRequest().
const Guzzle\Service\Command\AbstractCommand::RESPONSE_BODY = 'command.response_body' |
Definition at line 28 of file AbstractCommand.php.
Referenced by Guzzle\Tests\Service\Command\CommandTest\testCanChangeResponseBody().
const Guzzle\Service\Command\AbstractCommand::RESPONSE_PROCESSING = 'command.response_processing' |
Definition at line 37 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\OperationResponseParser\handleParsing(), Guzzle\Service\Command\AbstractCommand\prepare(), Guzzle\Service\Command\OperationCommand\process(), Guzzle\Service\Command\AbstractCommand\process(), Guzzle\Tests\Service\ClientTest\testAllowsCustomClientParameters(), and Guzzle\Tests\Service\Command\OperationCommandTest\testAllowsRawResponses().
const Guzzle\Service\Command\AbstractCommand::TYPE_MODEL = 'model' |
Definition at line 40 of file AbstractCommand.php.
Referenced by Guzzle\Service\Command\OperationResponseParser\handleParsing(), and Guzzle\Service\Command\AbstractCommand\prepare().
const Guzzle\Service\Command\AbstractCommand::TYPE_NO_TRANSLATION = 'no_translation' |
Definition at line 41 of file AbstractCommand.php.
const Guzzle\Service\Command\AbstractCommand::TYPE_RAW = 'raw' |
Definition at line 39 of file AbstractCommand.php.
Referenced by Guzzle\Tests\Service\Command\OperationCommandTest\testAllowsRawResponses().