xml_reference.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. XML Reference
  2. -------------
  3. ::
  4. <!-- MyBundle\Resources\config\serializer\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">
  10. <property name="some-property"
  11. exclude="true"
  12. expose="true"
  13. type="string"
  14. serialized-name="foo"
  15. since-version="1.0"
  16. until-version="1.1"
  17. xml-attribute="true"
  18. access-type="public_method"
  19. accessor-getter="getSomeProperty"
  20. accessor-setter="setSomeProperty"
  21. inline="true"
  22. read-only="true"
  23. >
  24. <!-- You can also specify the type as element which is necessary if
  25. your type contains "<" or ">" characters. -->
  26. <type><![CDATA[]]></type>
  27. <xml-list inline="true" entry-name="foobar" />
  28. <xml-map inline="true" key-attribute-name="foo" entry-name="bar" />
  29. </property>
  30. <callback-method name="foo" type="pre-serialize" />
  31. <callback-method name="bar" type="post-serialize" />
  32. <callback-method name="baz" type="post-deserialize" />
  33. </class>
  34. </serializer>