xml_reference.rst 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. XML Reference
  2. -------------
  3. ::
  4. <!-- MyBundle\Resources\config\serializer\Fully.Qualified.ClassName.xml -->
  5. <?xml version="1.0" encoding="UTF-8" ?>
  6. <serializer>
  7. <class name="Fully\Qualified\ClassName" exclusion-policy="ALL" xml-root-name="foo-bar" exclude="true"
  8. accessor-order="custom" custom-accessor-order="propertyName1,propertyName2,...,propertyNameN"
  9. access-type="public_method" discriminator-field-name="type">
  10. <xml-namespace prefix="atom" uri="http://www.w3.org/2005/Atom"/>
  11. <discriminator-class value="some-value">ClassName</discriminator-class>
  12. <property name="some-property"
  13. exclude="true"
  14. expose="true"
  15. type="string"
  16. serialized-name="foo"
  17. since-version="1.0"
  18. until-version="1.1"
  19. xml-attribute="true"
  20. access-type="public_method"
  21. accessor-getter="getSomeProperty"
  22. accessor-setter="setSomeProperty"
  23. inline="true"
  24. read-only="true"
  25. groups="foo,bar"
  26. xml-key-value-pairs="true"
  27. xml-attribute-map="true"
  28. max-depth="2"
  29. xml-namespace="http://www.w3.org/2005/Atom"
  30. >
  31. <!-- You can also specify the type as element which is necessary if
  32. your type contains "<" or ">" characters. -->
  33. <type><![CDATA[]]></type>
  34. <xml-list inline="true" entry-name="foobar" />
  35. <xml-map inline="true" key-attribute-name="foo" entry-name="bar" />
  36. <xml-element cdata="false" />
  37. </property>
  38. <callback-method name="foo" type="pre-serialize" />
  39. <callback-method name="bar" type="post-serialize" />
  40. <callback-method name="baz" type="post-deserialize" />
  41. <callback-method name="serializeToXml" type="handler" direction="serialization" format="xml" />
  42. <callback-method name="deserializeFromJson" type="handler" direction="deserialization" format="xml" />
  43. </class>
  44. </serializer>