xml_reference.rst 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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" read-only="false">
  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. >
  30. <!-- You can also specify the type as element which is necessary if
  31. your type contains "<" or ">" characters. -->
  32. <type><![CDATA[]]></type>
  33. <xml-list inline="true" entry-name="foobar" />
  34. <xml-map inline="true" key-attribute-name="foo" entry-name="bar" />
  35. <xml-element cdata="false" namespace="http://www.w3.org/2005/Atom"/>
  36. </property>
  37. <callback-method name="foo" type="pre-serialize" />
  38. <callback-method name="bar" type="post-serialize" />
  39. <callback-method name="baz" type="post-deserialize" />
  40. <callback-method name="serializeToXml" type="handler" direction="serialization" format="xml" />
  41. <callback-method name="deserializeFromJson" type="handler" direction="deserialization" format="xml" />
  42. <virtual-property method="public_method"
  43. name="some-property"
  44. exclude="true"
  45. expose="true"
  46. type="string"
  47. serialized-name="foo"
  48. since-version="1.0"
  49. until-version="1.1"
  50. xml-attribute="true"
  51. access-type="public_method"
  52. accessor-getter="getSomeProperty"
  53. accessor-setter="setSomeProperty"
  54. inline="true"
  55. read-only="true"
  56. groups="foo,bar"
  57. xml-key-value-pairs="true"
  58. xml-attribute-map="true"
  59. max-depth="2"
  60. >
  61. <!-- You can also specify the type as element which is necessary if
  62. your type contains "<" or ">" characters. -->
  63. <type><![CDATA[]]></type>
  64. <xml-list inline="true" entry-name="foobar" />
  65. <xml-map inline="true" key-attribute-name="foo" entry-name="bar" />
  66. </virtual-property>
  67. </class>
  68. </serializer>