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
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
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
content_moderation.state_transition_validation core/modules/content_moderation/content_moderation.services.yml Drupal\content_moderation\StateTransitionValidation
content_moderation.workspace_subscriber core/modules/content_moderation/content_moderation.services.yml Drupal\content_moderation\EventSubscriber\WorkspaceSubscriber
content_translation.delete_access core/modules/content_translation/content_translation.services.yml Drupal\content_translation\Access\ContentTranslationDeleteAccess access_check
content_translation.manager core/modules/content_translation/content_translation.services.yml Drupal\content_translation\ContentTranslationManager
content_translation.manage_access core/modules/content_translation/content_translation.services.yml Drupal\content_translation\Access\ContentTranslationManageAccessCheck access_check
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
content_translation.synchronizer core/modules/content_translation/content_translation.services.yml Drupal\content_translation\FieldTranslationSynchronizer
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 service_id_collector
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
database_driver_uninstall_validator core/core.services.yml Drupal\Core\Extension\DatabaseDriverUninstallValidator module_install.uninstall_validator
date.formatter core/core.services.yml Drupal\Core\Datetime\DateFormatter
datetime.time core/modules/update/tests/modules/update_test/update_test.services.yml Drupal\update_test\Datetime\TestTime
datetime.time core/core.services.yml Drupal\Component\Datetime\Time
default_plugin_manager core/core.services.yml Abstract
deprecation_test.alias core/modules/system/tests/modules/deprecation_test/deprecation_test.services.yml Alias of deprecation_test.service
deprecation_test.service core/modules/system/tests/modules/deprecation_test/deprecation_test.services.yml Drupal\deprecation_test\Deprecation\FixtureDeprecatedClass
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
Drupal\announcements_feed\AnnounceFetcher core/modules/announcements_feed/announcements_feed.services.yml
Drupal\announcements_feed\AnnounceRenderer core/modules/announcements_feed/announcements_feed.services.yml
Drupal\announcements_feed\LazyBuilders core/modules/announcements_feed/announcements_feed.services.yml
Drupal\autowire_test\TestInjection core/modules/system/tests/modules/autowire_test/autowire_test.services.yml
Drupal\autowire_test\TestInjection2 core/modules/system/tests/modules/autowire_test/autowire_test.services.yml
Drupal\autowire_test\TestInjection3 core/modules/system/tests/modules/autowire_test/autowire_test.services.yml
Drupal\autowire_test\TestInjectionInterface core/modules/system/tests/modules/autowire_test/autowire_test.services.yml Alias of Drupal\autowire_test\TestInjection
Drupal\autowire_test\TestInjectionInterface $testInjection3 core/modules/system/tests/modules/autowire_test/autowire_test.services.yml
Drupal\autowire_test\TestService core/modules/system/tests/modules/autowire_test/autowire_test.services.yml
Drupal\ban\BanIpManagerInterface core/modules/ban/ban.services.yml
Drupal\big_pipe\Render\BigPipe core/modules/big_pipe/big_pipe.services.yml
Drupal\block\BlockRepositoryInterface core/modules/block/block.services.yml

Other projects


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