\Guzzle\Service\Command\LocationVisitor\RequestXmlVisitor

Location visitor used to serialize XML bodies

Summary

Methods
Properties
Constants
after()
visit()
__construct()
setContentTypeHeader()
No public properties found
No constants found
prepareValue()
resolveRecursively()
createRootElement()
addXml()
writeAttribute()
writeElement()
startDocument()
finishDocument()
addXmlArray()
addXmlObject()
$data
$contentType
N/A
No private methods found
No private properties found
N/A

Properties

$data

$data : \SplObjectStorage

Type

\SplObjectStorage — Data object for persisting XML data

$contentType

$contentType : boolean

Type

boolean — Content-Type header added when XML is found

Methods

__construct()

__construct() 

setContentTypeHeader()

setContentTypeHeader(string  $header) : self

Change the content-type header that is added when XML is found

Parameters

string $header

Header to set when XML is found

Returns

self

prepareValue()

prepareValue(mixed  $value, \Guzzle\Service\Description\Parameter  $param) : array|mixed

Prepare (filter and set desired name for request item) the value for request.

Parameters

mixed $value
\Guzzle\Service\Description\Parameter $param

Returns

array|mixed

resolveRecursively()

resolveRecursively(array  $value, \Guzzle\Service\Description\Parameter  $param) : array

Map nested parameters into the location_key based parameters

Parameters

array $value

Value to map

\Guzzle\Service\Description\Parameter $param

Parameter that holds information about the current key

Returns

array —

Returns the mapped array

createRootElement()

createRootElement(\Guzzle\Service\Description\Operation  $operation) : \XMLWriter

Create the root XML element to use with a request

Parameters

\Guzzle\Service\Description\Operation $operation

Operation object

Returns

\XMLWriter

addXml()

addXml(\XMLWriter  $xmlWriter, \Guzzle\Service\Description\Parameter  $param, mixed  $value) 

Recursively build the XML body

Parameters

\XMLWriter $xmlWriter

XML to modify

\Guzzle\Service\Description\Parameter $param

API Parameter

mixed $value

Value to add

writeAttribute()

writeAttribute(\XMLWriter  $xmlWriter, string  $prefix, string  $name, string  $namespace, string  $value) 

Write an attribute with namespace if used

Parameters

\XMLWriter $xmlWriter

XMLWriter instance

string $prefix

Namespace prefix if any

string $name

Attribute name

string $namespace

The uri of the namespace

string $value

The attribute content

writeElement()

writeElement(\XMLWriter  $xmlWriter, string  $prefix, string  $name, string  $namespace, string  $value) 

Write an element with namespace if used

Parameters

\XMLWriter $xmlWriter

XML writer resource

string $prefix

Namespace prefix if any

string $name

Element name

string $namespace

The uri of the namespace

string $value

The element content

startDocument()

startDocument(string  $encoding) : \XMLWriter

Create a new xml writer and start a document

Parameters

string $encoding

document encoding

Returns

\XMLWriter —

the writer resource

finishDocument()

finishDocument(\XMLWriter  $xmlWriter) : \string

End the document and return the output

Parameters

\XMLWriter $xmlWriter

Returns

\string —

the writer resource

addXmlArray()

addXmlArray(\XMLWriter  $xmlWriter, \Guzzle\Service\Description\Parameter  $param,   $value) 

Add an array to the XML

Parameters

\XMLWriter $xmlWriter
\Guzzle\Service\Description\Parameter $param
$value

addXmlObject()

addXmlObject(\XMLWriter  $xmlWriter, \Guzzle\Service\Description\Parameter  $param,   $value) 

Add an object to the XML

Parameters

\XMLWriter $xmlWriter
\Guzzle\Service\Description\Parameter $param
$value