hal.services.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. services:
  2. serializer.normalizer.entity_reference_item.hal:
  3. class: Drupal\hal\Normalizer\EntityReferenceItemNormalizer
  4. arguments: ['@hal.link_manager', '@serializer.entity_resolver', '@entity_type.manager']
  5. tags:
  6. - { name: normalizer, priority: 10 }
  7. serializer.normalizer.field_item.hal:
  8. class: Drupal\hal\Normalizer\FieldItemNormalizer
  9. tags:
  10. - { name: normalizer, priority: 10 }
  11. serializer.normalizer.field.hal:
  12. class: Drupal\hal\Normalizer\FieldNormalizer
  13. tags:
  14. - { name: normalizer, priority: 10 }
  15. serializer.normalizer.file_entity.hal:
  16. class: Drupal\hal\Normalizer\FileEntityNormalizer
  17. arguments: ['@entity_type.manager', '@hal.link_manager', '@module_handler', '@config.factory', '@entity_type.repository', '@entity_field.manager']
  18. tags:
  19. - { name: normalizer, priority: 20 }
  20. serializer.normalizer.timestamp_item.hal:
  21. class: Drupal\hal\Normalizer\TimestampItemNormalizer
  22. tags:
  23. # Priority must be higher than serializer.normalizer.field_item.hal.
  24. - { name: normalizer, priority: 20, bc: bc_timestamp_normalizer_unix, bc_config_name: 'serialization.settings' }
  25. serializer.normalizer.entity.hal:
  26. class: Drupal\hal\Normalizer\ContentEntityNormalizer
  27. arguments: ['@hal.link_manager', '@entity_type.manager', '@module_handler', '@entity_type.repository', '@entity_field.manager']
  28. tags:
  29. - { name: normalizer, priority: 10 }
  30. serializer.encoder.hal:
  31. class: Drupal\hal\Encoder\JsonEncoder
  32. tags:
  33. - { name: encoder, priority: 10, format: hal_json }
  34. # Link managers.
  35. hal.link_manager:
  36. class: Drupal\hal\LinkManager\LinkManager
  37. arguments: ['@hal.link_manager.type', '@hal.link_manager.relation']
  38. hal.link_manager.type:
  39. class: Drupal\hal\LinkManager\TypeLinkManager
  40. arguments: ['@cache.default', '@module_handler', '@config.factory', '@request_stack', '@entity_type.bundle.info', '@entity_type.manager']
  41. hal.link_manager.relation:
  42. class: Drupal\hal\LinkManager\RelationLinkManager
  43. arguments: ['@cache.default', '@entity_type.manager', '@module_handler', '@config.factory', '@request_stack', '@entity_type.bundle.info', '@entity_field.manager']