yml_reference.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. YAML Reference
  2. --------------
  3. ::
  4. # MyBundle\Resources\config\serializer\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. properties:
  13. some-property:
  14. exclude: true
  15. expose: true
  16. access_type: public_method # defaults to property
  17. accessor: # access_type must be set to public_method
  18. getter: getSomeOtherProperty
  19. setter: setSomeOtherProperty
  20. type: string
  21. serialized_name: foo
  22. since_version: 1.0
  23. until_version: 1.1
  24. groups: [foo, bar]
  25. xml_attribute: true
  26. xml_value: true
  27. inline: true
  28. read_only: true
  29. xml_key_value_pairs: true
  30. xml_list:
  31. inline: true
  32. entry_name: foo
  33. xml_map:
  34. inline: true
  35. key_attribute_name: foo
  36. entry_name: bar
  37. xml_attribute_map: true
  38. handler_callbacks:
  39. serialization:
  40. xml: serializeToXml
  41. json: serializeToJson
  42. deserialization:
  43. xml: deserializeFromXml
  44. callback_methods:
  45. pre_serialize: [foo, bar]
  46. post_serialize: [foo, bar]
  47. post_deserialize: [foo, bar]