yml_reference.rst 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. YAML Reference
  2. --------------
  3. ::
  4. # MyBundle\Resources\config\serializer\Fully.Qualified.ClassName.yml
  5. Fully\Qualified\ClassName:
  6. exclusion_policy: ALL
  7. xml_root_name: foobar
  8. exclude: true
  9. access_type: public_method # defaults to property
  10. accessor_order: custom
  11. custom_accessor_order: [propertyName1, propertyName2, ..., propertyNameN]
  12. discriminator:
  13. field_name: type
  14. map:
  15. some-value: ClassName
  16. virtual_properties:
  17. getSomeProperty: {}
  18. xml_namespaces:
  19. "": http://your.default.namespace
  20. atom: http://www.w3.org/2005/Atom
  21. properties:
  22. some-property:
  23. exclude: true
  24. expose: true
  25. access_type: public_method # defaults to property
  26. accessor: # access_type must be set to public_method
  27. getter: getSomeOtherProperty
  28. setter: setSomeOtherProperty
  29. type: string
  30. serialized_name: foo
  31. since_version: 1.0
  32. until_version: 1.1
  33. groups: [foo, bar]
  34. xml_attribute: true
  35. xml_value: true
  36. inline: true
  37. read_only: true
  38. xml_key_value_pairs: true
  39. xml_list:
  40. inline: true
  41. entry_name: foo
  42. xml_map:
  43. inline: true
  44. key_attribute_name: foo
  45. entry_name: bar
  46. xml_attribute_map: true
  47. xml_element:
  48. cdata: false
  49. max_depth: 2
  50. xml_namespace: http://www.w3.org/2005/Atom
  51. handler_callbacks:
  52. serialization:
  53. xml: serializeToXml
  54. json: serializeToJson
  55. deserialization:
  56. xml: deserializeFromXml
  57. callback_methods:
  58. pre_serialize: [foo, bar]
  59. post_serialize: [foo, bar]
  60. post_deserialize: [foo, bar]