Services - 8.9.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 893

Title File name Summary All service tags
content_translation.overview_access core/modules/content_translation/content_translation.services.yml Drupal\content_translation\Access\ContentTranslationOverviewAccess access_check
content_translation.subscriber core/modules/content_translation/content_translation.services.yml Drupal\content_translation\Routing\ContentTranslationRouteSubscriber event_subscriber
content_translation.synchronizer core/modules/content_translation/content_translation.services.yml Drupal\content_translation\FieldTranslationSynchronizer
content_translation.updates_manager core/modules/content_translation/content_translation.services.yml Drupal\content_translation\ContentTranslationUpdatesManager
content_type_header_matcher core/core.services.yml Drupal\Core\Routing\ContentTypeHeaderMatcher route_filter
content_uninstall_validator core/core.services.yml Drupal\Core\Entity\ContentUninstallValidator module_install.uninstall_validator
context.handler core/core.services.yml Drupal\Core\Plugin\Context\ContextHandler
context.repository core/core.services.yml Drupal\Core\Plugin\Context\LazyContextRepository
controller.entity_form core/core.services.yml Drupal\Core\Entity\HtmlEntityFormController
controller.form core/core.services.yml Drupal\Core\Controller\HtmlFormController
controller_resolver core/core.services.yml Drupal\Core\Controller\ControllerResolver
count.jsonapi.resource_type.repository core/modules/jsonapi/tests/modules/jsonapi_test_collection_count/jsonapi_test_collection_count.services.yml Drupal\jsonapi_test_collection_count\ResourceType\CountableResourceTypeRepository
country_manager core/core.services.yml Drupal\Core\Locale\CountryManager
cron core/core.services.yml Drupal\Core\Cron
csrf_token core/core.services.yml Drupal\Core\Access\CsrfTokenGenerator
current_route_match core/core.services.yml Drupal\Core\Routing\CurrentRouteMatch
current_user core/core.services.yml Drupal\Core\Session\AccountProxy
database core/core.services.yml Drupal\Core\Database\Connection
database.replica core/core.services.yml Drupal\Core\Database\Connection
database.replica_kill_switch core/core.services.yml Drupal\Core\Database\ReplicaKillSwitch event_subscriber
date.formatter core/core.services.yml Drupal\Core\Datetime\DateFormatter
datetime.time core/core.services.yml Drupal\Component\Datetime\Time
datetime.time core/modules/update/tests/modules/update_test/update_test.services.yml Drupal\update_test\Datetime\TestTime
default_plugin_manager core/core.services.yml Abstract
diff.formatter core/core.services.yml Drupal\Core\Diff\DiffFormatter
display_variant_test.page_display_variant_subscriber core/modules/system/tests/modules/display_variant_test/display_variant_test.services.yml Drupal\display_variant_test\EventSubscriber\TestPageDisplayVariantSubscriber event_subscriber
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 event_subscriber
early_rendering_controller_wrapper_subscriber core/core.services.yml Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber event_subscriber
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 event_subscriber
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 event_subscriber
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.manager core/core.services.yml Drupal\Core\Entity\EntityManager
entity.memory_cache core/core.services.yml Drupal\Core\Cache\MemoryCache\MemoryCache
entity.query core/core.services.yml Drupal\Core\Entity\Query\QueryFactory
entity.query.config core/core.services.yml Drupal\Core\Config\Entity\Query\QueryFactory event_subscriber
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

Other projects


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