Services - 9.5.x - drupal

Primary tabs

Introduction to services

A "service" (such as accessing the database, sending email, or translating user interface text) can be defined by a module or Drupal core. Defining a service means giving it a name and designating a default class to provide the service; ideally, there should also be an interface that defines the methods that may be called. Services are collected into the Dependency Injection Container, and can be overridden to use different classes or different instantiation by modules. See the Services and Dependency Injection Container topic for details.

Some services have tags, which are defined in the service definition. Tags are used to define a group of related services, or to specify some aspect of how the service behaves. See the Service Tags topic for more information.

See also

Services and Dependency Injection Container

Service Tags

File

core/core.api.php, line 905

Title File name Summary All service tags
serialization.entity_resolver.target_id core/modules/serialization/serialization.services.yml Drupal\serialization\EntityResolver\TargetIdResolver entity_resolver
serialization.exception.default core/modules/serialization/serialization.services.yml Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber event_subscriber
serialization.json core/core.services.yml Drupal\Component\Serialization\Json
serialization.normalizer.field core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\FieldNormalizer normalizer
serialization.normalizer.field_item core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\FieldItemNormalizer normalizer
serialization.phpserialize core/core.services.yml Drupal\Component\Serialization\PhpSerialize
serialization.user_route_alter_subscriber core/modules/serialization/serialization.services.yml Drupal\serialization\EventSubscriber\UserRouteAlterSubscriber event_subscriber
serialization.yaml core/core.services.yml Drupal\Component\Serialization\Yaml
serializer core/modules/serialization/serialization.services.yml Symfony\Component\Serializer\Serializer
serializer.encoder.hal core/modules/hal/hal.services.yml Drupal\hal\Encoder\JsonEncoder encoder
serializer.encoder.json core/modules/serialization/serialization.services.yml Drupal\serialization\Encoder\JsonEncoder encoder
serializer.encoder.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Encoder\JsonEncoder jsonapi_encoder
serializer.encoder.serialization_test core/modules/serialization/tests/serialization_test/serialization_test.services.yml Drupal\serialization_test\SerializationTestEncoder encoder
serializer.encoder.xml core/modules/serialization/serialization.services.yml Drupal\serialization\Encoder\XmlEncoder encoder
serializer.entity_resolver core/modules/serialization/serialization.services.yml Drupal\serialization\EntityResolver\ChainEntityResolver
serializer.entity_resolver.uuid core/modules/serialization/serialization.services.yml Drupal\serialization\EntityResolver\UuidResolver entity_resolver
serializer.normalizer.boolean.datatype.emoji core/modules/serialization/tests/modules/test_datatype_boolean_emoji_normalizer/test_datatype_boolean_emoji_normalizer.services.yml Drupal\test_datatype_boolean_emoji_normalizer\Normalizer\BooleanNormalizer normalizer
serializer.normalizer.boolean.fieldtype.emoji core/modules/serialization/tests/modules/test_fieldtype_boolean_emoji_normalizer/test_fieldtype_boolean_emoji_normalizer.services.yml Drupal\test_fieldtype_boolean_emoji_normalizer\Normalizer\BooleanItemNormalizer normalizer
serializer.normalizer.complex_data core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\ComplexDataNormalizer normalizer
serializer.normalizer.config_entity core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\ConfigEntityNormalizer normalizer
serializer.normalizer.config_entity.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\ConfigEntityDenormalizer jsonapi_normalizer
serializer.normalizer.content_entity core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\ContentEntityNormalizer normalizer
serializer.normalizer.content_entity.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\ContentEntityDenormalizer jsonapi_normalizer
serializer.normalizer.data.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\DataNormalizer jsonapi_normalizer
serializer.normalizer.datetimeiso8601 core/modules/serialization/serialization.services.yml \Drupal\serialization\Normalizer\DateTimeIso8601Normalizer normalizer
serializer.normalizer.entity core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\EntityNormalizer normalizer
serializer.normalizer.entity.hal core/modules/hal/hal.services.yml Drupal\hal\Normalizer\ContentEntityNormalizer normalizer
serializer.normalizer.entity_access_exception.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\EntityAccessDeniedHttpExceptionNormalizer jsonapi_normalizer
serializer.normalizer.entity_reference_field_item core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\EntityReferenceFieldItemNormalizer normalizer
serializer.normalizer.entity_reference_item.hal core/modules/hal/hal.services.yml Drupal\hal\Normalizer\EntityReferenceItemNormalizer normalizer
serializer.normalizer.field.hal core/modules/hal/hal.services.yml Drupal\hal\Normalizer\FieldNormalizer normalizer
serializer.normalizer.field.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\FieldNormalizer jsonapi_normalizer
serializer.normalizer.field_item.hal core/modules/hal/hal.services.yml Drupal\hal\Normalizer\FieldItemNormalizer normalizer
serializer.normalizer.field_item.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\FieldItemNormalizer jsonapi_normalizer
serializer.normalizer.file_entity.hal core/modules/hal/hal.services.yml Drupal\hal\Normalizer\FileEntityNormalizer normalizer
serializer.normalizer.http_exception.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\HttpExceptionNormalizer jsonapi_normalizer
serializer.normalizer.jsonapi_document_toplevel.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer jsonapi_normalizer
serializer.normalizer.link_collection.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\LinkCollectionNormalizer jsonapi_normalizer
serializer.normalizer.list core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\ListNormalizer normalizer
serializer.normalizer.password_field_item core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\NullNormalizer normalizer
serializer.normalizer.primitive_data core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\PrimitiveDataNormalizer normalizer
serializer.normalizer.relationship.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\RelationshipNormalizer jsonapi_normalizer
serializer.normalizer.resource_identifier.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\ResourceIdentifierNormalizer jsonapi_normalizer
serializer.normalizer.resource_object.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\ResourceObjectNormalizer jsonapi_normalizer
serializer.normalizer.safe_string core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\MarkupNormalizer normalizer
serializer.normalizer.serialization_test core/modules/serialization/tests/serialization_test/serialization_test.services.yml Drupal\serialization_test\SerializationTestNormalizer normalizer
serializer.normalizer.silly_fielditem core/modules/serialization/tests/modules/field_normalization_test/field_normalization_test.services.yml Drupal\field_normalization_test\Normalization\TextItemSillyNormalizer normalizer
serializer.normalizer.string.jsonapi_test_data_type core/modules/jsonapi/tests/modules/jsonapi_test_data_type/jsonapi_test_data_type.services.yml Drupal\jsonapi_test_data_type\Normalizer\StringNormalizer normalizer
serializer.normalizer.string.jsonapi_test_field_type core/modules/jsonapi/tests/modules/jsonapi_test_field_type/jsonapi_test_field_type.services.yml Drupal\jsonapi_test_field_type\Normalizer\StringNormalizer normalizer
serializer.normalizer.timestamp core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\TimestampNormalizer normalizer

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.