yml_reference.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. inline: true
  27. read_only: true
  28. xml_key_value_pairs: true
  29. xml_list:
  30. inline: true
  31. entry_name: foo
  32. xml_map:
  33. inline: true
  34. key_attribute_name: foo
  35. entry_name: bar
  36. callback_methods:
  37. pre_serialize: [foo, bar]
  38. post_serialize: [foo, bar]
  39. post_deserialize: [foo, bar]