hal.services.yml 1.63 KB
Newer Older
1 2 3
services:
  serializer.normalizer.entity_reference_item.hal:
    class: Drupal\hal\Normalizer\EntityReferenceItemNormalizer
4
    arguments: ['@hal.link_manager', '@serializer.entity_resolver']
5 6 7 8 9 10 11 12 13 14
    tags:
      - { name: normalizer, priority: 10 }
  serializer.normalizer.field_item.hal:
    class: Drupal\hal\Normalizer\FieldItemNormalizer
    tags:
      - { name: normalizer, priority: 10 }
  serializer.normalizer.field.hal:
    class: Drupal\hal\Normalizer\FieldNormalizer
    tags:
      - { name: normalizer, priority: 10 }
15 16 17 18
  serializer.normalizer.file_entity.hal:
    class: Drupal\hal\Normalizer\FileEntityNormalizer
    tags:
      - { name: normalizer, priority: 20 }
19
    arguments: ['@entity.manager', '@http_client', '@hal.link_manager', '@module_handler']
20
  serializer.normalizer.entity.hal:
21
    class: Drupal\hal\Normalizer\ContentEntityNormalizer
22
    arguments: ['@hal.link_manager', '@entity.manager', '@module_handler']
23 24 25 26 27 28
    tags:
      - { name: normalizer, priority: 10 }
  serializer.encoder.hal:
    class: Drupal\hal\Encoder\JsonEncoder
    tags:
      - { name: encoder, priority: 10, format: hal_json }
29 30 31 32 33 34 35 36 37 38 39

  # Link managers.
  hal.link_manager:
    class: Drupal\hal\LinkManager\LinkManager
    arguments: ['@hal.link_manager.type', '@hal.link_manager.relation']
  hal.link_manager.type:
    class: Drupal\hal\LinkManager\TypeLinkManager
    arguments: ['@cache.default', '@module_handler', '@config.factory', '@request_stack', '@entity_type.bundle.info']
  hal.link_manager.relation:
    class: Drupal\hal\LinkManager\RelationLinkManager
    arguments: ['@cache.default', '@entity.manager', '@module_handler', '@config.factory', '@request_stack']