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
cache_tags.invalidator.checksum core/core.services.yml Drupal\Core\Cache\DatabaseCacheTagsChecksum cache_tags_invalidator, backend_overridable
ckeditor5.ckeditor5_cache_tag core/modules/ckeditor5/ckeditor5.services.yml Drupal\ckeditor5\EventSubscriber\CKEditor5CacheTag event_subscriber
ckeditor5.smart_default_settings core/modules/ckeditor5/ckeditor5.services.yml Drupal\ckeditor5\SmartDefaultSettings
ckeditor5.stylesheets.message core/modules/ckeditor5/ckeditor5.services.yml Drupal\ckeditor5\CKEditor5StylesheetsMessage
class_resolver core/core.services.yml Drupal\Core\DependencyInjection\ClassResolver
client_error_response_subscriber core/core.services.yml Drupal\Core\EventSubscriber\ClientErrorResponseSubscriber event_subscriber
color.config_cache_invalidator core/modules/color/color.services.yml Drupal\color\EventSubscriber\ColorConfigCacheInvalidator event_subscriber
comment.breadcrumb core/modules/comment/comment.services.yml Drupal\comment\CommentBreadcrumbBuilder breadcrumb_builder
comment.lazy_builders core/modules/comment/comment.services.yml Drupal\comment\CommentLazyBuilders
comment.link_builder core/modules/comment/comment.services.yml Drupal\comment\CommentLinkBuilder
comment.manager core/modules/comment/comment.services.yml Drupal\comment\CommentManager
comment.statistics core/modules/comment/comment.services.yml Drupal\comment\CommentStatistics backend_overridable
config.config_subscriber core/modules/config/config.services.yml Drupal\config\ConfigSubscriber event_subscriber
config.factory core/core.services.yml Drupal\Core\Config\ConfigFactory event_subscriber, service_collector
config.importer_subscriber core/core.services.yml Drupal\Core\Config\Importer\FinalMissingContentSubscriber event_subscriber
config.import_transformer core/core.services.yml Drupal\Core\Config\ImportStorageTransformer
config.installer core/core.services.yml Drupal\Core\Config\ConfigInstaller
config.manager core/core.services.yml Drupal\Core\Config\ConfigManager
config.storage core/core.services.yml Drupal\Core\Config\CachedStorage
config.storage.active core/core.services.yml Drupal\Core\Config\DatabaseStorage backend_overridable
config.storage.export core/core.services.yml Drupal\Core\Config\ManagedStorage
config.storage.export.manager core/core.services.yml Drupal\Core\Config\ExportStorageManager
config.storage.schema core/core.services.yml Drupal\Core\Config\ExtensionInstallStorage
config.storage.snapshot core/core.services.yml Drupal\Core\Config\DatabaseStorage backend_overridable
config.storage.staging core/core.services.yml Alias of config.storage.sync
config.storage.sync core/core.services.yml Drupal\Core\Config\FileStorage
config.typed core/core.services.yml Drupal\Core\Config\TypedConfigManager plugin_manager_cache_clear
config_events_test.event_subscriber core/modules/config/tests/config_events_test/config_events_test.services.yml Drupal\config_events_test\EventSubscriber event_subscriber
config_events_test.event_subscriber core/modules/config/tests/config_collection_install_test/config_collection_install_test.services.yml Drupal\config_collection_install_test\EventSubscriber event_subscriber
config_exclude_modules_subscriber core/core.services.yml Drupal\Core\EventSubscriber\ExcludedModulesEventSubscriber event_subscriber
config_import_subscriber core/core.services.yml Drupal\Core\EventSubscriber\ConfigImportSubscriber event_subscriber, service_collector
config_import_test.event_subscriber core/modules/config/tests/config_import_test/config_import_test.services.yml Drupal\config_import_test\EventSubscriber event_subscriber
config_override_integration_test.config_override core/modules/config/tests/config_override_integration_test/config_override_integration_test.services.yml Drupal\config_override_integration_test\CacheabilityMetadataConfigOverride config.factory.override
config_override_test.low_priority_overrider core/modules/config/tests/config_override_test/config_override_test.services.yml Drupal\config_override_test\ConfigOverriderLowPriority config.factory.override
config_override_test.overrider core/modules/config/tests/config_override_test/config_override_test.services.yml Drupal\config_override_test\ConfigOverrider config.factory.override
config_override_test.pirate_day_cacheability_metadata_override core/modules/config/tests/config_override_test/config_override_test.services.yml Drupal\config_override_test\PirateDayCacheabilityMetadataConfigOverride config.factory.override
config_snapshot_subscriber core/core.services.yml Drupal\Core\EventSubscriber\ConfigSnapshotSubscriber event_subscriber
config_transformer_test.event_subscriber core/modules/config/tests/config_transformer_test/config_transformer_test.services.yml Drupal\config_transformer_test\EventSubscriber event_subscriber
config_translation.access.form core/modules/config_translation/config_translation.services.yml Drupal\config_translation\Access\ConfigTranslationFormAccess access_check
config_translation.access.overview core/modules/config_translation/config_translation.services.yml Drupal\config_translation\Access\ConfigTranslationOverviewAccess access_check
config_translation.route_subscriber core/modules/config_translation/config_translation.services.yml Drupal\config_translation\Routing\RouteSubscriber event_subscriber
config_translation_test_event_subscriber core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.services.yml Drupal\config_translation_test\EventSubscriber\ConfigTranslationTestSubscriber event_subscriber
contact.mail_handler core/modules/contact/contact.services.yml Drupal\contact\MailHandler
container.namespaces core/core.services.yml ArrayObject
container.trait core/core.services.yml Abstract
content_moderation.config_import_subscriber core/modules/content_moderation/content_moderation.services.yml Drupal\content_moderation\EventSubscriber\ConfigImportSubscriber event_subscriber
content_moderation.moderation_information core/modules/content_moderation/content_moderation.services.yml Drupal\content_moderation\ModerationInformation
content_moderation.route_subscriber core/modules/content_moderation/content_moderation.services.yml Drupal\content_moderation\Routing\ContentModerationRouteSubscriber event_subscriber
content_moderation.state_transition_validation core/modules/content_moderation/content_moderation.services.yml Drupal\content_moderation\StateTransitionValidation
content_translation.delete_access core/modules/content_translation/content_translation.services.yml Drupal\content_translation\Access\ContentTranslationDeleteAccess access_check

Other projects


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