PHP 클래스 Symfony\Component\Serializer\Encoder\XmlEncoder

저자: Jordi Boggiano ([email protected])
저자: John Wards ([email protected])
저자: Fabian Vogler ([email protected])
상속: extends Symfony\Component\Serializer\Encoder\SerializerAwareEncoder, implements Symfony\Component\Serializer\Encoder\EncoderInterface, implements Symfony\Component\Serializer\Encoder\DecoderInterface, implements NormalizationAwareInterface
파일 보기 프로젝트 열기: symfony/symfony 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $rootNodeName = 'response', integer | null $loadOptions = null ) Construct new XmlEncoder and allow to change the root node element name.
decode ( $data, $format, array $context = [] )
encode ( $data, $format, array $context = [] )
getRootNodeName ( ) : string Returns the root node name.
setRootNodeName ( string $name ) Sets the root node name.
supportsDecoding ( $format )
supportsEncoding ( $format )

보호된 메소드들

메소드 설명
appendCData ( DOMNode $node, string $val ) : boolean
appendDocumentFragment ( DOMNode $node, DOMDocumentFragment $fragment ) : boolean
appendText ( DOMNode $node, string $val ) : boolean
appendXMLString ( DOMNode $node, string $val ) : boolean
isElementNameValid ( string $name ) : boolean Checks the name is a valid xml element name.

비공개 메소드들

메소드 설명
appendNode ( DOMNode $parentNode, array | object $data, string $nodeName, string $key = null ) : boolean Selects the type of node to create and appends it to the parent.
buildXml ( DOMNode $parentNode, array | object $data, string | null $xmlRootNodeName = null ) : boolean Parse the data and convert it to DOMElements.
createDomDocument ( array $context ) : DOMDocument Create a DOM document, taking serializer options into account.
needsCdataWrapping ( string $val ) : boolean Checks if a value contains any characters which would require CDATA wrapping.
parseXml ( DOMNode $node ) : array | string Parse the input DOMNode into an array or a string.
parseXmlAttributes ( DOMNode $node ) : array Parse the input DOMNode attributes into an array.
parseXmlValue ( DOMNode $node ) : array | string Parse the input DOMNode value (content and children) into an array or a string.
resolveXmlRootName ( array $context = [] ) : string Get real XML root node name, taking serializer options into account.
selectNodeType ( DOMNode $node, mixed $val ) : boolean Tests the value being passed and decide what sort of element to create.

메소드 상세

__construct() 공개 메소드

Construct new XmlEncoder and allow to change the root node element name.
public __construct ( string $rootNodeName = 'response', integer | null $loadOptions = null )
$rootNodeName string
$loadOptions integer | null A bit field of LIBXML_* constants

appendCData() 최종 보호된 메소드

final protected appendCData ( DOMNode $node, string $val ) : boolean
$node DOMNode
$val string
리턴 boolean

appendDocumentFragment() 최종 보호된 메소드

final protected appendDocumentFragment ( DOMNode $node, DOMDocumentFragment $fragment ) : boolean
$node DOMNode
$fragment DOMDocumentFragment
리턴 boolean

appendText() 최종 보호된 메소드

final protected appendText ( DOMNode $node, string $val ) : boolean
$node DOMNode
$val string
리턴 boolean

appendXMLString() 최종 보호된 메소드

final protected appendXMLString ( DOMNode $node, string $val ) : boolean
$node DOMNode
$val string
리턴 boolean

decode() 공개 메소드

public decode ( $data, $format, array $context = [] )
$context array

encode() 공개 메소드

public encode ( $data, $format, array $context = [] )
$context array

getRootNodeName() 공개 메소드

Returns the root node name.
public getRootNodeName ( ) : string
리턴 string

isElementNameValid() 최종 보호된 메소드

Checks the name is a valid xml element name.
final protected isElementNameValid ( string $name ) : boolean
$name string
리턴 boolean

setRootNodeName() 공개 메소드

Sets the root node name.
public setRootNodeName ( string $name )
$name string root node name

supportsDecoding() 공개 메소드

public supportsDecoding ( $format )

supportsEncoding() 공개 메소드

public supportsEncoding ( $format )