Properties

$locationName

$locationName : string

Type

string

$writer

$writer : \XMLWriter

Type

\XMLWriter — XML writer resource

$contentType

$contentType : string

Type

string — Content-Type header added when XML is found

$buffered

$buffered : \GuzzleHttp\Command\Guzzle\Parameter[]

Type

Parameter[] — Buffered elements to write

Methods

__construct()

__construct(string  $locationName = 'xml', string  $contentType = 'application/xml') : mixed

Set the name of the location

Parameters

string $locationName

Name of the location

string $contentType

Set to a non-empty string to add a Content-Type header to a request if any XML content is added to the body. Pass an empty string to disable the addition of the header.

Returns

mixed —

visit()

visit(\GuzzleHttp\Command\CommandInterface  $command, \Psr\Http\Message\RequestInterface  $request, \GuzzleHttp\Command\Guzzle\Parameter  $param) : \Psr\Http\Message\RequestInterface

Visits a location for each top-level parameter

Parameters

\GuzzleHttp\Command\CommandInterface $command
\Psr\Http\Message\RequestInterface $request
\GuzzleHttp\Command\Guzzle\Parameter $param

Returns

\Psr\Http\Message\RequestInterface —

after()

after(\GuzzleHttp\Command\CommandInterface  $command, \Psr\Http\Message\RequestInterface  $request, \GuzzleHttp\Command\Guzzle\Operation  $operation) : \Psr\Http\Message\RequestInterface

Called when all of the parameters of a command have been visited.

Parameters

\GuzzleHttp\Command\CommandInterface $command
\Psr\Http\Message\RequestInterface $request
\GuzzleHttp\Command\Guzzle\Operation $operation

Returns

\Psr\Http\Message\RequestInterface —

prepareValue()

prepareValue(mixed  $value, \GuzzleHttp\Command\Guzzle\Parameter  $param) : array|mixed

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

Parameters

mixed $value
\GuzzleHttp\Command\Guzzle\Parameter $param

Returns

array|mixed —

resolveRecursively()

resolveRecursively(array  $value, \GuzzleHttp\Command\Guzzle\Parameter  $param) : array

Recursively prepare and filter nested values.

Parameters

array $value

Value to map

\GuzzleHttp\Command\Guzzle\Parameter $param

Parameter related to the current key.

Returns

array —

Returns the mapped array

createRootElement()

createRootElement(\GuzzleHttp\Command\Guzzle\Operation  $operation) : \XMLWriter

Create the root XML element to use with a request

Parameters

\GuzzleHttp\Command\Guzzle\Operation $operation

Operation object

Returns

\XMLWriter —

addXml()

addXml(\XMLWriter  $writer, \GuzzleHttp\Command\Guzzle\Parameter  $param, mixed  $value) : mixed

Recursively build the XML body

Parameters

\XMLWriter $writer

XML to modify

\GuzzleHttp\Command\Guzzle\Parameter $param

API Parameter

mixed $value

Value to add

Returns

mixed —

writeAttribute()

writeAttribute(\XMLWriter  $writer, string  $prefix, string  $name, string  $namespace, string  $value) : mixed

Write an attribute with namespace if used

Parameters

\XMLWriter $writer

XMLWriter instance

string $prefix

Namespace prefix if any

string $name

Attribute name

string $namespace

The uri of the namespace

string $value

The attribute content

Returns

mixed —

writeElement()

writeElement(\XMLWriter  $writer, string  $prefix, string  $name, string  $namespace, string  $value) : mixed

Write an element with namespace if used

Parameters

\XMLWriter $writer

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

Returns

mixed —

startDocument()

startDocument(string  $encoding) : \XMLWriter

Create a new xml writer and start a document

Parameters

string $encoding

document encoding

Throws

\RuntimeException

if the document cannot be started

Returns

\XMLWriter —

the writer resource

finishDocument()

finishDocument(\XMLWriter  $writer) : string

End the document and return the output

Parameters

\XMLWriter $writer

Returns

string —

the writer resource

addXmlArray()

addXmlArray(\XMLWriter  $writer, \GuzzleHttp\Command\Guzzle\Parameter  $param,  $value) : mixed

Add an array to the XML

Parameters

\XMLWriter $writer
\GuzzleHttp\Command\Guzzle\Parameter $param
$value

Returns

mixed —

addXmlObject()

addXmlObject(\XMLWriter  $writer, \GuzzleHttp\Command\Guzzle\Parameter  $param,  $value) : mixed

Add an object to the XML

Parameters

\XMLWriter $writer
\GuzzleHttp\Command\Guzzle\Parameter $param
$value

Returns

mixed —

visitWithValue()

visitWithValue( $value, \GuzzleHttp\Command\Guzzle\Parameter  $param, \GuzzleHttp\Command\Guzzle\Operation  $operation) : mixed

Parameters

$value
\GuzzleHttp\Command\Guzzle\Parameter $param
\GuzzleHttp\Command\Guzzle\Operation $operation

Returns

mixed —