yml_reference.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. atom: http://www.w3.org/2005/Atom
  20. properties:
  21. some-property:
  22. exclude: true
  23. expose: true
  24. access_type: public_method # defaults to property
  25. accessor: # access_type must be set to public_method
  26. getter: getSomeOtherProperty
  27. setter: setSomeOtherProperty
  28. type: string
  29. serialized_name: foo
  30. since_version: 1.0
  31. until_version: 1.1
  32. groups: [foo, bar]
  33. xml_attribute: true
  34. xml_value: true
  35. inline: true
  36. read_only: true
  37. xml_key_value_pairs: true
  38. xml_list:
  39. inline: true
  40. entry_name: foo
  41. xml_map:
  42. inline: true
  43. key_attribute_name: foo
  44. entry_name: bar
  45. xml_attribute_map: true
  46. xml_element:
  47. cdata: false
  48. max_depth: 2
  49. xml_namespace: http://www.w3.org/2005/Atom
  50. handler_callbacks:
  51. serialization:
  52. xml: serializeToXml
  53. json: serializeToJson
  54. deserialization:
  55. xml: deserializeFromXml
  56. callback_methods:
  57. pre_serialize: [foo, bar]
  58. post_serialize: [foo, bar]
  59. post_deserialize: [foo, bar]