yml_reference.rst 1.8 KB

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