Services - 11.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 900

Title File name Summary All service tags
serializer.normalizer.field.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\FieldNormalizer jsonapi_normalizer
serializer.normalizer.field_item.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\FieldItemNormalizer jsonapi_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_field_item 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
serializer.normalizer.timestamp_item core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\TimestampItemNormalizer normalizer
serializer.normalizer.traversable_object.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\TraversableObjectNormalizer normalizer
serializer.normalizer.typed_data core/modules/serialization/serialization.services.yml Drupal\serialization\Normalizer\TypedDataNormalizer normalizer
serializer.normalizer.unprocessable_entity_exception.jsonapi core/modules/jsonapi/jsonapi.services.yml Drupal\jsonapi\Normalizer\UnprocessableHttpEntityExceptionNormalizer jsonapi_normalizer
services_default_test.no_autowire core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml Drupal\services_defaults_test\TestService
services_default_test.no_autowire.arg core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml Drupal\services_defaults_test\TestInjection
service_provider_test_class core/modules/system/tests/modules/service_provider_test/service_provider_test.services.yml Drupal\service_provider_test\TestClass needs_destruction
session_test.session_bag core/modules/system/tests/modules/session_test/session_test.services.yml Drupal\session_test\Session\TestSessionBag session_bag
session_test.session_handler.test_proxy core/modules/system/tests/modules/session_test/session_test.services.yml Drupal\session_test\Session\TestSessionHandlerProxy session_handler_proxy
session_test.session_handler.test_proxy2 core/modules/system/tests/modules/session_test/session_test.services.yml Drupal\session_test\Session\TestSessionHandlerProxy session_handler_proxy
session_test.session_handler_proxy_trace core/modules/system/tests/modules/session_test/session_test.services.yml ArrayObject
session_test.subscriber core/modules/system/tests/modules/session_test/session_test.services.yml Drupal\session_test\EventSubscriber\SessionTestSubscriber
settings_tray_override_test.overrider core/modules/settings_tray/tests/modules/settings_tray_override_test/settings_tray_override_test.services.yml Drupal\settings_tray_override_test\ConfigOverrider config.factory.override
shortcut.lazy_builders core/modules/shortcut/shortcut.services.yml Drupal\shortcut\ShortcutLazyBuilders
sqlite.views.date_sql core/modules/views/views.services.yml Drupal\views\Plugin\views\query\SqliteDateSql
statistics.storage.node core/modules/statistics/statistics.services.yml Drupal\statistics\NodeStatisticsDatabaseStorage backend_overridable
stream_wrapper.dummy core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyStreamWrapper stream_wrapper
stream_wrapper.dummy_external_readonly core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyExternalReadOnlyWrapper stream_wrapper
stream_wrapper.dummy_multiple core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyMultipleStreamWrapper stream_wrapper
stream_wrapper.dummy_readonly core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyReadOnlyStreamWrapper stream_wrapper
stream_wrapper.dummy_remote core/modules/file/tests/file_test/file_test.services.yml Drupal\file_test\StreamWrapper\DummyRemoteStreamWrapper stream_wrapper
stream_wrapper.translations core/modules/locale/locale.services.yml Drupal\locale\StreamWrapper\TranslationsStream stream_wrapper
string_translator.locale.lookup core/modules/locale/locale.services.yml Drupal\locale\LocaleTranslation string_translator, needs_destruction
system.access_route_alter_subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\AccessRouteAlterSubscriber
system.admin_path.route_subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\AdminRouteSubscriber
system.advisories_config_subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\AdvisoriesConfigSubscriber
system.breadcrumb.default core/modules/system/system.services.yml Drupal\system\PathBasedBreadcrumbBuilder breadcrumb_builder
system.config_cache_tag core/modules/system/system.services.yml Drupal\system\EventSubscriber\ConfigCacheTag
system.config_subscriber core/modules/system/system.services.yml Drupal\system\SystemConfigSubscriber
system.file_event.subscriber core/modules/system/system.services.yml Drupal\system\EventSubscriber\SecurityFileUploadEventSubscriber
system.manager core/modules/system/system.services.yml Drupal\system\SystemManager
system.menus.route_subscriber core/modules/system/system.services.yml Drupal\system\Routing\MenuLinksetRoutes
system.module_admin_links_helper core/modules/system/system.services.yml Drupal\system\ModuleAdminLinksHelper

Other projects


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