Class Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor

InheritanceGuzzle\Service\Command\LocationVisitor\Request\XmlVisitor » Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor
ImplementsGuzzle\Service\Command\LocationVisitor\Request\RequestVisitorInterface

Location visitor used to serialize XML bodies

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$contentType bool Content-Type header added when XML is found Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor
$data SplObjectStorage Data object for persisting XML data Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor

Property Details

$contentType protected property

Content-Type header added when XML is found

protected bool $contentType 'application/xml'
$data protected property

Data object for persisting XML data

protected SplObjectStorage $data null

Method Details

__construct() public method

public void __construct ( )
addXml() protected method

Recursively build the XML body

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

XML to modify

$param Guzzle\Service\Description\Parameter

API Parameter

$value mixed

Value to add

addXmlArray() protected method

Add an array to the XML

protected void addXmlArray ( XMLWriter $xmlWriter, Guzzle\Service\Description\Parameter $param, &$value )
$xmlWriter
$param
$value
addXmlObject() protected method

Add an object to the XML

protected void addXmlObject ( XMLWriter $xmlWriter, Guzzle\Service\Description\Parameter $param, &$value )
$xmlWriter
$param
$value
after() public method

public void after ( Guzzle\Service\Command\CommandInterface $command, Guzzle\Http\Message\RequestInterface $request )
$command
$request
createRootElement() protected method

Create the root XML element to use with a request

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

Operation object

finishDocument() protected method

End the document and return the output

protected \string finishDocument ( $xmlWriter )
$xmlWriter XMLWriter
return \string

The writer resource

setContentTypeHeader() public method

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

public self setContentTypeHeader ( $header )
$header string

Header to set when XML is found

startDocument() protected method

Create a new xml writer and start a document

protected XMLWriter startDocument ( $encoding )
$encoding string

Document encoding

return XMLWriter

The writer resource

visit() public method

public void visit ( Guzzle\Service\Command\CommandInterface $command, Guzzle\Http\Message\RequestInterface $request, Guzzle\Service\Description\Parameter $param, $value )
$command
$request
$param
$value
writeAttribute() protected method

Write an attribute with namespace if used

protected void writeAttribute ( $xmlWriter, $prefix, $name, $namespace, $value )
$xmlWriter XMLWriter

XMLWriter instance

$prefix string

Namespace prefix if any

$name string

Attribute name

$namespace string

The uri of the namespace

$value string

The attribute content

writeElement() protected method

Write an element with namespace if used

protected void writeElement ( XMLWriter $xmlWriter, $prefix, $name, $namespace, $value )
$xmlWriter XMLWriter

XML writer resource

$prefix string

Namespace prefix if any

$name string

Element name

$namespace string

The uri of the namespace

$value string

The element content