Open Journal Systems  3.3.0
Guzzle\Service\Description\Operation Class Reference
Inheritance diagram for Guzzle\Service\Description\Operation:
Guzzle\Service\Description\OperationInterface Guzzle\Common\ToArrayInterface

Public Member Functions

 __construct (array $config=array(), ServiceDescriptionInterface $description=null)
 
 addErrorResponse ($code, $reason, $class)
 
 addParam (Parameter $param)
 
 getAdditionalParameters ()
 
 getClass ()
 
 getData ($name)
 
 getDeprecated ()
 
 getDocumentationUrl ()
 
 getErrorResponses ()
 
 getHttpMethod ()
 
 getName ()
 
 getNotes ()
 
 getParam ($param)
 
 getParamNames ()
 
 getParams ()
 
 getResponseClass ()
 
 getResponseNotes ()
 
 getResponseType ()
 
 getServiceDescription ()
 
 getSummary ()
 
 getUri ()
 
 hasParam ($name)
 
 removeParam ($name)
 
 setAdditionalParameters ($parameter)
 
 setClass ($className)
 
 setData ($name, $value)
 
 setDeprecated ($isDeprecated)
 
 setDocumentationUrl ($docUrl)
 
 setErrorResponses (array $errorResponses)
 
 setHttpMethod ($httpMethod)
 
 setName ($name)
 
 setNotes ($notes)
 
 setResponseClass ($responseClass)
 
 setResponseNotes ($notes)
 
 setResponseType ($responseType)
 
 setServiceDescription (ServiceDescriptionInterface $description)
 
 setSummary ($summary)
 
 setUri ($uri)
 
 toArray ()
 

Data Fields

const DEFAULT_COMMAND_CLASS = 'Guzzle\\Service\\Command\\OperationCommand'
 
- Data Fields inherited from Guzzle\Service\Description\OperationInterface
const TYPE_CLASS = 'class'
 
const TYPE_DOCUMENTATION = 'documentation'
 
const TYPE_MODEL = 'model'
 
const TYPE_PRIMITIVE = 'primitive'
 

Protected Member Functions

 inferResponseType ()
 

Protected Attributes

 $additionalParameters
 
 $class
 
 $data
 
 $deprecated
 
 $description
 
 $documentationUrl
 
 $errorResponses
 
 $httpMethod
 
 $name
 
 $notes
 
 $parameters = array()
 
 $responseClass
 
 $responseNotes
 
 $responseType
 
 $summary
 
 $uri
 

Static Protected Attributes

static $properties
 

Detailed Description

Data object holding the information of an API command

Definition at line 10 of file Operation.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Service\Description\Operation::__construct ( array  $config = array(),
ServiceDescriptionInterface  $description = null 
)

Builds an Operation object using an array of configuration data:

  • name: (string) Name of the command
  • httpMethod: (string) HTTP method of the operation
  • uri: (string) URI template that can create a relative or absolute URL
  • class: (string) Concrete class that implements this command
  • parameters: (array) Associative array of parameters for the command. {
    See also
    Parameter} for information.
  • summary: (string) This is a short summary of what the operation does
  • notes: (string) A longer text field to explain the behavior of the operation.
  • documentationUrl: (string) Reference URL providing more information about the operation
  • responseClass: (string) This is what is returned from the method. Can be a primitive, PSR-0 compliant class name, or model.
  • responseNotes: (string) Information about the response returned by the operation
  • responseType: (string) One of 'primitive', 'class', 'model', or 'documentation'. If not specified, this value will be automatically inferred based on whether or not there is a model matching the name, if a matching PSR-0 compliant class name is found, or set to 'primitive' by default.
  • deprecated: (bool) Set to true if this is a deprecated command
  • errorResponses: (array) Errors that could occur when executing the command. Array of hashes, each with a 'code' (the HTTP response code), 'reason' (response reason phrase or description of the error), and 'class' (a custom exception class that would be thrown if the error is encountered).
  • data: (array) Any extra data that might be used to help build or serialize the operation
  • additionalParameters: (null|array) Parameter schema to use when an option is passed to the operation that is not in the schema
Parameters
array$configArray of configuration data
ServiceDescriptionInterface$descriptionService description used to resolve models if $ref tags are found

Definition at line 147 of file Operation.php.

References Guzzle\Service\Description\Operation\$description, Guzzle\Service\Description\Operation\$name, Guzzle\Service\Description\Operation\addParam(), Guzzle\Service\Description\Operation\inferResponseType(), and Guzzle\Service\Description\Operation\setResponseType().

Member Function Documentation

◆ addErrorResponse()

Guzzle\Service\Description\Operation::addErrorResponse (   $code,
  $reason,
  $class 
)

Add an error to the command

Parameters
string$codeHTTP response code
string$reasonHTTP response reason phrase or information about the error
string$classException class associated with the error
Returns
self

Definition at line 514 of file Operation.php.

References Guzzle\Service\Description\Operation\$class.

◆ addParam()

Guzzle\Service\Description\Operation::addParam ( Parameter  $param)

Add a parameter to the command

Parameters
Parameter$paramParameter to add
Returns
self

Definition at line 256 of file Operation.php.

References Guzzle\Service\Description\Parameter\getName(), and Guzzle\Service\Description\Parameter\setParent().

Referenced by Guzzle\Service\Description\Operation\__construct().

◆ getAdditionalParameters()

Guzzle\Service\Description\Operation::getAdditionalParameters ( )

Get the additionalParameters of the operation

Returns
Parameter|null

Definition at line 560 of file Operation.php.

References Guzzle\Service\Description\Operation\$additionalParameters.

◆ getClass()

Guzzle\Service\Description\Operation::getClass ( )

Get the concrete operation class that implements this operation

Returns
string

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 297 of file Operation.php.

References Guzzle\Service\Description\Operation\$class.

◆ getData()

Guzzle\Service\Description\Operation::getData (   $name)

Get extra data from the operation

Parameters
string$nameName of the data point to retrieve
Returns
mixed|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 535 of file Operation.php.

References Guzzle\Service\Description\Operation\$name.

Referenced by Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor\createRootElement().

◆ getDeprecated()

Guzzle\Service\Description\Operation::getDeprecated ( )

Get whether or not the operation is deprecated

Returns
bool

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 462 of file Operation.php.

References Guzzle\Service\Description\Operation\$deprecated.

◆ getDocumentationUrl()

Guzzle\Service\Description\Operation::getDocumentationUrl ( )

Get the documentation URL of the operation

Returns
string|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 373 of file Operation.php.

References Guzzle\Service\Description\Operation\$documentationUrl.

◆ getErrorResponses()

Guzzle\Service\Description\Operation::getErrorResponses ( )

Get the errors that could be encountered when executing the operation

Returns
array

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 500 of file Operation.php.

References Guzzle\Service\Description\Operation\$errorResponses.

Referenced by Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin\getErrorClosure().

◆ getHttpMethod()

Guzzle\Service\Description\Operation::getHttpMethod ( )

Get the HTTP method of the operation

Returns
string|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 278 of file Operation.php.

References Guzzle\Service\Description\Operation\$httpMethod.

◆ getName()

Guzzle\Service\Description\Operation::getName ( )

Get the name of the operation

Returns
string|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 316 of file Operation.php.

References Guzzle\Service\Description\Operation\$name.

◆ getNotes()

Guzzle\Service\Description\Operation::getNotes ( )

Get a longer text field to explain the behavior of the operation

Returns
string|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 354 of file Operation.php.

References Guzzle\Service\Description\Operation\$notes.

◆ getParam()

Guzzle\Service\Description\Operation::getParam (   $param)

Get a single parameter of the operation

Parameters
string$paramParameter to retrieve by name
Returns
Parameter|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 244 of file Operation.php.

◆ getParamNames()

Guzzle\Service\Description\Operation::getParamNames ( )

Returns an array of parameter names

Returns
array

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 234 of file Operation.php.

◆ getParams()

Guzzle\Service\Description\Operation::getParams ( )

Get the params of the operation

Returns
array

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 229 of file Operation.php.

References Guzzle\Service\Description\Operation\$parameters.

◆ getResponseClass()

Guzzle\Service\Description\Operation::getResponseClass ( )

Get what is returned from the method. Can be a primitive, class name, or model. For example, the responseClass could be 'array', which would inherently use a responseType of 'primitive'. Using a class name would set a responseType of 'class'. Specifying a model by ID will use a responseType of 'model'.

Returns
string|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 392 of file Operation.php.

References Guzzle\Service\Description\Operation\$responseClass.

◆ getResponseNotes()

Guzzle\Service\Description\Operation::getResponseNotes ( )

Get notes about the response of the operation

Returns
string|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 443 of file Operation.php.

References Guzzle\Service\Description\Operation\$responseNotes.

◆ getResponseType()

Guzzle\Service\Description\Operation::getResponseType ( )

Get information about how the response is unmarshalled: One of 'primitive', 'class', 'model', or 'documentation'

Returns
string

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 413 of file Operation.php.

References Guzzle\Service\Description\Operation\$responseType.

◆ getServiceDescription()

Guzzle\Service\Description\Operation::getServiceDescription ( )

Get the service description that the operation belongs to

Returns
ServiceDescriptionInterface|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 217 of file Operation.php.

References Guzzle\Service\Description\Operation\$description.

◆ getSummary()

Guzzle\Service\Description\Operation::getSummary ( )

Get a short summary of what the operation does

Returns
string|null

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 335 of file Operation.php.

References Guzzle\Service\Description\Operation\$summary.

◆ getUri()

Guzzle\Service\Description\Operation::getUri ( )

Get the URI that will be merged into the generated request

Returns
string

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 481 of file Operation.php.

References Guzzle\Service\Description\Operation\$uri.

◆ hasParam()

Guzzle\Service\Description\Operation::hasParam (   $name)

Check if the operation has a specific parameter by name

Parameters
string$nameName of the param
Returns
bool

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 239 of file Operation.php.

References Guzzle\Service\Description\Operation\$name.

◆ inferResponseType()

Guzzle\Service\Description\Operation::inferResponseType ( )
protected

◆ removeParam()

Guzzle\Service\Description\Operation::removeParam (   $name)

Remove a parameter from the command

Parameters
string$nameName of the parameter to remove
Returns
self

Definition at line 271 of file Operation.php.

References Guzzle\Service\Description\Operation\$name.

◆ setAdditionalParameters()

Guzzle\Service\Description\Operation::setAdditionalParameters (   $parameter)

Set the additionalParameters of the operation

Parameters
Parameter | null$parameterParameter to set
Returns
self

Definition at line 572 of file Operation.php.

◆ setClass()

Guzzle\Service\Description\Operation::setClass (   $className)

Set the concrete class of the command

Parameters
string$classNameConcrete class name
Returns
self

Definition at line 309 of file Operation.php.

◆ setData()

Guzzle\Service\Description\Operation::setData (   $name,
  $value 
)

Set a particular data point on the operation

Parameters
string$nameName of the data value
mixed$valueValue to set
Returns
self

Definition at line 548 of file Operation.php.

References Guzzle\Service\Description\Operation\$name.

◆ setDeprecated()

Guzzle\Service\Description\Operation::setDeprecated (   $isDeprecated)

Set whether or not the command is deprecated

Parameters
bool$isDeprecatedSet to true to mark as deprecated
Returns
self

Definition at line 474 of file Operation.php.

◆ setDocumentationUrl()

Guzzle\Service\Description\Operation::setDocumentationUrl (   $docUrl)

Set the URL pointing to additional documentation on the command

Parameters
string$docUrlDocumentation URL
Returns
self

Definition at line 385 of file Operation.php.

◆ setErrorResponses()

Guzzle\Service\Description\Operation::setErrorResponses ( array  $errorResponses)

Set all of the error responses of the operation

Parameters
array$errorResponsesHash of error name to a hash containing a code, reason, class
Returns
self

Definition at line 528 of file Operation.php.

References Guzzle\Service\Description\Operation\$errorResponses.

◆ setHttpMethod()

Guzzle\Service\Description\Operation::setHttpMethod (   $httpMethod)

Set the HTTP method of the command

Parameters
string$httpMethodMethod to set
Returns
self

Definition at line 290 of file Operation.php.

References Guzzle\Service\Description\Operation\$httpMethod.

◆ setName()

Guzzle\Service\Description\Operation::setName (   $name)

Set the name of the command

Parameters
string$nameName of the command
Returns
self

Definition at line 328 of file Operation.php.

References Guzzle\Service\Description\Operation\$name.

◆ setNotes()

Guzzle\Service\Description\Operation::setNotes (   $notes)

Set a longer text field to explain the behavior of the operation.

Parameters
string$notesNotes on the operation
Returns
self

Definition at line 366 of file Operation.php.

References Guzzle\Service\Description\Operation\$notes.

◆ setResponseClass()

Guzzle\Service\Description\Operation::setResponseClass (   $responseClass)

Set what is returned from the method. Can be a primitive, class name, or model. For example: 'array', 'Guzzle\Foo\Baz', or 'MyModelName' (to reference a model by ID).

Parameters
string$responseClassType of response
Returns
self

Definition at line 405 of file Operation.php.

References Guzzle\Service\Description\Operation\$responseClass, and Guzzle\Service\Description\Operation\inferResponseType().

◆ setResponseNotes()

Guzzle\Service\Description\Operation::setResponseNotes (   $notes)

Set notes about the response of the operation

Parameters
string$notesResponse notes
Returns
self

Definition at line 455 of file Operation.php.

References Guzzle\Service\Description\Operation\$notes.

◆ setResponseType()

Guzzle\Service\Description\Operation::setResponseType (   $responseType)

Set qualifying information about the responseClass. One of 'primitive', 'class', 'model', or 'documentation'

Parameters
string$responseTypeResponse type information
Returns
self
Exceptions
InvalidArgumentException

Definition at line 426 of file Operation.php.

References Guzzle\Service\Description\Operation\$responseType.

Referenced by Guzzle\Service\Description\Operation\__construct().

◆ setServiceDescription()

Guzzle\Service\Description\Operation::setServiceDescription ( ServiceDescriptionInterface  $description)

Set the service description that the operation belongs to

Parameters
ServiceDescriptionInterface$descriptionService description
Returns
self

Implements Guzzle\Service\Description\OperationInterface.

Definition at line 222 of file Operation.php.

References Guzzle\Service\Description\Operation\$description.

◆ setSummary()

Guzzle\Service\Description\Operation::setSummary (   $summary)

Set a short summary of what the operation does

Parameters
string$summaryShort summary of the operation
Returns
self

Definition at line 347 of file Operation.php.

References Guzzle\Service\Description\Operation\$summary.

◆ setUri()

Guzzle\Service\Description\Operation::setUri (   $uri)

Set the URI template of the command

Parameters
string$uriURI template to set
Returns
self

Definition at line 493 of file Operation.php.

References Guzzle\Service\Description\Operation\$uri.

◆ toArray()

Guzzle\Service\Description\Operation::toArray ( )

Get the array representation of an object

Returns
array

Implements Guzzle\Common\ToArrayInterface.

Definition at line 193 of file Operation.php.

Field Documentation

◆ $additionalParameters

Parameter Guzzle\Service\Description\Operation::$additionalParameters
protected

Additional parameters schema

Definition at line 33 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getAdditionalParameters().

◆ $class

string Guzzle\Service\Description\Operation::$class
protected

Class of the command object

Definition at line 75 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\addErrorResponse(), and Guzzle\Service\Description\Operation\getClass().

◆ $data

array Guzzle\Service\Description\Operation::$data
protected

Extra operation information

Definition at line 117 of file Operation.php.

◆ $deprecated

bool Guzzle\Service\Description\Operation::$deprecated
protected

Whether or not the command is deprecated

Definition at line 99 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getDeprecated().

◆ $description

◆ $documentationUrl

string Guzzle\Service\Description\Operation::$documentationUrl
protected

Reference URL providing more information about the operation

Definition at line 63 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getDocumentationUrl().

◆ $errorResponses

array Guzzle\Service\Description\Operation::$errorResponses
protected

Array of errors that could occur when running the command

Definition at line 105 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getErrorResponses(), and Guzzle\Service\Description\Operation\setErrorResponses().

◆ $httpMethod

string Guzzle\Service\Description\Operation::$httpMethod
protected

◆ $name

◆ $notes

string Guzzle\Service\Description\Operation::$notes
protected

A longer text field to explain the behavior of the operation.

Definition at line 57 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getNotes(), Guzzle\Service\Description\Operation\setNotes(), and Guzzle\Service\Description\Operation\setResponseNotes().

◆ $parameters

string Guzzle\Service\Description\Operation::$parameters = array()
protected

Definition at line 27 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getParams().

◆ $properties

Guzzle\Service\Description\Operation::$properties
staticprotected
Initial value:
= array(
'name' => true, 'httpMethod' => true, 'uri' => true, 'class' => true, 'responseClass' => true,
'responseType' => true, 'responseNotes' => true, 'notes' => true, 'summary' => true, 'documentationUrl' => true,
'deprecated' => true, 'data' => true, 'parameters' => true, 'additionalParameters' => true,
'errorResponses' => true
)

Definition at line 17 of file Operation.php.

◆ $responseClass

string Guzzle\Service\Description\Operation::$responseClass
protected

This is what is returned from the method

Definition at line 81 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getResponseClass(), and Guzzle\Service\Description\Operation\setResponseClass().

◆ $responseNotes

string Guzzle\Service\Description\Operation::$responseNotes
protected

Information about the response returned by the operation

Definition at line 93 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getResponseNotes().

◆ $responseType

string Guzzle\Service\Description\Operation::$responseType
protected

Type information about the response

Definition at line 87 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getResponseType(), and Guzzle\Service\Description\Operation\setResponseType().

◆ $summary

string Guzzle\Service\Description\Operation::$summary
protected

This is a short summary of what the operation does

Definition at line 51 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getSummary(), and Guzzle\Service\Description\Operation\setSummary().

◆ $uri

string Guzzle\Service\Description\Operation::$uri
protected

HTTP URI of the command

Definition at line 69 of file Operation.php.

Referenced by Guzzle\Service\Description\Operation\getUri(), and Guzzle\Service\Description\Operation\setUri().

◆ DEFAULT_COMMAND_CLASS

const Guzzle\Service\Description\Operation::DEFAULT_COMMAND_CLASS = 'Guzzle\\Service\\Command\\OperationCommand'

Default command class to use when none is specified

Definition at line 14 of file Operation.php.


The documentation for this class was generated from the following file: