Services - 10.3.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
Drupal\Core\Theme\ComponentNegotiator core/core.services.yml
Drupal\Core\Theme\Component\ComponentValidator core/core.services.yml
Drupal\Core\Theme\Component\SchemaCompatibilityChecker core/core.services.yml
Drupal\database_test\EventSubscriber\DatabaseEventSubscriber core/modules/system/tests/modules/database_test/database_test.services.yml
Drupal\destructable_test\Destructable core/modules/system/tests/modules/destructable_test/destructable_test.services.yml needs_destruction
Drupal\performance_test\DatabaseEventEnabler core/modules/system/tests/modules/performance_test/performance_test.services.yml http_middleware
Drupal\performance_test\PerformanceDataCollector core/modules/system/tests/modules/performance_test/performance_test.services.yml event_subscriber, needs_destruction
Drupal\sdc\ComponentNegotiator core/modules/sdc/sdc.services.yml Alias of Drupal\Core\Theme\ComponentNegotiator
Drupal\sdc\Component\ComponentValidator core/modules/sdc/sdc.services.yml Alias of Drupal\Core\Theme\Component\ComponentValidator
Drupal\sdc\Component\SchemaCompatibilityChecker core/modules/sdc/sdc.services.yml Alias of Drupal\Core\Theme\Component\SchemaCompatibilityChecker
Drupal\sdc\Twig\TwigComponentLoader core/modules/sdc/sdc.services.yml Alias of Drupal\Core\Template\Loader\ComponentLoader
Drupal\sdc\Twig\TwigExtension core/modules/sdc/sdc.services.yml Alias of Drupal\Core\Template\ComponentsTwigExtension
Drupal\services_defaults_test\TestInjection core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\services_defaults_test\TestInjection2 core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml zee.bang, bar.tag2
Drupal\services_defaults_test\TestPrivateService core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\services_defaults_test\TestService core/modules/system/tests/modules/services_defaults_test/services_defaults_test.services.yml
Drupal\user_route_alter_test\Routing\RouteSubscriber core/modules/serialization/tests/modules/user_route_alter_test/user_route_alter_test.services.yml
dynamic_page_cache_deny_admin_routes core/modules/dynamic_page_cache/dynamic_page_cache.services.yml Drupal\dynamic_page_cache\PageCache\ResponsePolicy\DenyAdminRoutes dynamic_page_cache_response_policy
dynamic_page_cache_request_policy core/modules/dynamic_page_cache/dynamic_page_cache.services.yml Drupal\dynamic_page_cache\PageCache\RequestPolicy\DefaultRequestPolicy service_collector
dynamic_page_cache_response_policy core/modules/dynamic_page_cache/dynamic_page_cache.services.yml Drupal\Core\PageCache\ChainResponsePolicy service_collector
dynamic_page_cache_subscriber core/modules/dynamic_page_cache/dynamic_page_cache.services.yml Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber
early_rendering_controller_wrapper_subscriber core/core.services.yml Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber
early_translation_test.authentication.early_translation_test core/modules/locale/tests/modules/early_translation_test/early_translation_test.services.yml Drupal\early_translation_test\Auth authentication_provider
editor.config_translation_mapper_subscriber core/modules/editor/editor.services.yml Drupal\editor\EventSubscriber\EditorConfigTranslationSubscriber
element.editor core/modules/editor/editor.services.yml Drupal\editor\Element
element_info core/core.services.yml Alias of plugin.manager.element_info
email.validator core/core.services.yml Drupal\Component\Utility\EmailValidator
entity.autocomplete_matcher core/core.services.yml Drupal\Core\Entity\EntityAutocompleteMatcher
entity.bundle_config_import_validator core/core.services.yml Drupal\Core\Entity\Event\BundleConfigImportValidate
entity.definition_update_manager core/core.services.yml Drupal\Core\Entity\EntityDefinitionUpdateManager
entity.form_builder core/core.services.yml Drupal\Core\Entity\EntityFormBuilder
entity.last_installed_schema.repository core/core.services.yml Drupal\Core\Entity\EntityLastInstalledSchemaRepository
entity.memory_cache core/core.services.yml Drupal\Core\Cache\MemoryCache\MemoryCache
entity.query.config core/core.services.yml Drupal\Core\Config\Entity\Query\QueryFactory
entity.query.keyvalue core/core.services.yml Drupal\Core\Entity\KeyValueStore\Query\QueryFactory
entity.query.null core/core.services.yml Drupal\Core\Entity\Query\Null\QueryFactory
entity.query.sql core/core.services.yml Drupal\Core\Entity\Query\Sql\QueryFactory backend_overridable
entity.repository core/core.services.yml Drupal\Core\Entity\EntityRepository
entity_bundle.listener core/core.services.yml Drupal\Core\Entity\EntityBundleListener
entity_display.repository core/core.services.yml Drupal\Core\Entity\EntityDisplayRepository
entity_field.deleted_fields_repository core/core.services.yml Drupal\Core\Field\DeletedFieldsRepository
entity_field.manager core/core.services.yml Drupal\Core\Entity\EntityFieldManager
entity_route_subscriber core/core.services.yml Drupal\Core\EventSubscriber\EntityRouteProviderSubscriber
entity_test.definition.subscriber core/modules/system/tests/modules/entity_test/entity_test.services.yml Drupal\entity_test\EntityTestDefinitionSubscriber
entity_test_update.entity_schema_listener core/modules/system/tests/modules/entity_test_update/entity_test_update.services.yml Drupal\entity_test_update\EventSubscriber\EntitySchemaSubscriber
entity_type.bundle.info core/core.services.yml Drupal\Core\Entity\EntityTypeBundleInfo
entity_type.listener core/core.services.yml Drupal\Core\Entity\EntityTypeListener
entity_type.manager core/core.services.yml Drupal\Core\Entity\EntityTypeManager plugin_manager_cache_clear
entity_type.repository core/core.services.yml Drupal\Core\Entity\EntityTypeRepository
event_dispatcher core/core.services.yml Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher

Other projects


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