Classes, traits, and interfaces - 9.5.x - drupal

Primary tabs

Introduction to classes

A lot of the PHP code in Drupal is object oriented (OO), making use of PHP classes, interfaces, and traits. See the Objected-oriented programming conventions for more information.

See also

Objected-oriented programming conventions

File

core/core.api.php, line 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
DbCommandBaseTester class Drupal\Tests\system\Kernel\Scripts core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php Concrete command implementation for testing base features.
DbDumpApplication class Drupal\Core\Command core/lib/Drupal/Core/Command/DbDumpApplication.php Provides a command to dump a database generation script. 2
DbDumpCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/DbDumpCommand.php Provides a command to dump the current database to a script. 1
DbDumpCommandTest class Drupal\Tests\system\Kernel\Scripts core/modules/system/tests/src/Kernel/Scripts/DbDumpCommandTest.php Test that the DbDumpCommand works correctly.
DbDumpTest class Drupal\KernelTests\Core\Command core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php Tests for the database dump commands.
DbImportCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/DbImportCommand.php Provides a command to import the current database from a script. 1
DbImportCommandTest class Drupal\Tests\system\Kernel\Scripts core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php Test that the DbImportCommand works correctly.
DbLog class Drupal\dblog\Logger core/modules/dblog/src/Logger/DbLog.php Logs events in the watchdog database table. 2
DblogClearLogConfirmForm class Drupal\dblog\Form core/modules/dblog/src/Form/DblogClearLogConfirmForm.php Provides a confirmation form before clearing out the logs. 1
DbLogController class Drupal\dblog\Controller core/modules/dblog/src/Controller/DbLogController.php Returns responses for dblog routes. 2
DbLogControllerTest class Drupal\Tests\dblog\Kernel core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php Tests for the DbLogController class.
DblogFilterForm class Drupal\dblog\Form core/modules/dblog/src/Form/DblogFilterForm.php Provides the database logging filter form.
DbLogFormInjectionTest class Drupal\Tests\dblog\Kernel core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php Tests serializing a form with an injected dblog logger instance.
DblogMessage class Drupal\dblog\Plugin\views\field core/modules/dblog/src/Plugin/views/field/DblogMessage.php Provides a field handler that renders a log event with replaced variables.
DblogOperations class Drupal\dblog\Plugin\views\field core/modules/dblog/src/Plugin/views/field/DblogOperations.php Provides a field handler that renders operation link markup.
DBLogResource class Drupal\dblog\Plugin\rest\resource core/modules/dblog/src/Plugin/rest/resource/DBLogResource.php Provides a resource for database watchdog log entries.
DbLogResourceTest class Drupal\Tests\hal\Functional\dblog core/modules/hal/tests/src/Functional/dblog/DbLogResourceTest.php Tests the watchdog database log resource.
DbLogTest class Drupal\Tests\dblog\Kernel core/modules/dblog/tests/src/Kernel/DbLogTest.php Generate events and verify dblog entries.
DbLogTest class Drupal\Tests\dblog\Functional core/modules/dblog/tests/src/Functional/DbLogTest.php Verifies log entries and user access based on permissions. 1
DblogTypes class Drupal\dblog\Plugin\views\filter core/modules/dblog/src/Plugin/views/filter/DblogTypes.php Exposes log types to views module.
DbLogViewsTest class Drupal\Tests\dblog\Functional core/modules/dblog/tests/src/Functional/DbLogViewsTest.php Verifies user access to log reports based on permissions.
DbToolsApplication class Drupal\Core\Command core/lib/Drupal/Core/Command/DbToolsApplication.php Provides a command to import a database generation script. 2
DbToolsApplicationTest class Drupal\Tests\system\Kernel\Scripts core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php Test that the DbToolsApplication works correctly.
DbUpdateAccessCheck class Drupal\system\Access core/modules/system/src/Access/DbUpdateAccessCheck.php Access check for database update routes. 2
DbUpdateController class Drupal\system\Controller core/modules/system/src/Controller/DbUpdateController.php Controller routines for database update routes.
DbUpdateNegotiator class Drupal\system\Theme core/modules/system/src/Theme/DbUpdateNegotiator.php Sets the active theme for the database update pages. 2
DCOM58Test class Drupal\Tests\Component\Annotation\Doctrine\Ticket core/tests/Drupal/Tests/Component/Annotation/Doctrine/Ticket/DCOM58Test.php This class is a near-copy of \Doctrine\Tests\Common\Annotations\Ticket\DCOM58Test, which is part of the Doctrine project: <http://www.doctrine-project.org>. It was copied from version 1.2.7.
DebugExtension final class Drupal\Core\Template core/lib/Drupal/Core/Template/DebugExtension.php A class providing Drupal Twig Debug extension. 2
DecimalFormatter class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php Plugin implementation of the 'number_decimal' formatter.
DecimalItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php Defines the 'decimal' field type.
DecoratedServiceTest class Drupal\Tests\system\Kernel core/modules/system/tests/src/Kernel/DecoratedServiceTest.php Test handling of decorated services in DependencySerializationTraitPass.
DefaultAccessCheck class Drupal\Core\Access core/lib/Drupal/Core/Access/DefaultAccessCheck.php Allows access to routes to be controlled by an '_access' boolean parameter. 2 2
DefaultAccessCheckTest class Drupal\Tests\Core\Access core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php @coversDefaultClass \Drupal\Core\Access\DefaultAccessCheck @group Access
DefaultConfigTest class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/DefaultConfigTest.php Tests default configuration of the Extension system.
DefaultConfigTest class Drupal\KernelTests\Config core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php Tests that the installed config matches the default config.
DefaultConfigTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/DefaultConfigTest.php Tests that default configuration provided by all modules matches schema.
DefaultContentFilesAccessTest class Drupal\Tests\demo_umami_content\Functional core/profiles/demo_umami/modules/demo_umami_content/tests/src/Functional/DefaultContentFilesAccessTest.php Tests that files provided by demo_umami_content are not accessible.
DefaultDisplay class Drupal\views\Plugin\views\display core/modules/views/src/Plugin/views/display/DefaultDisplay.php A plugin to handle defaults on a view. 1
DefaultDisplayExtender class Drupal\views\Plugin\views\display_extender core/modules/views/src/Plugin/views/display_extender/DefaultDisplayExtender.php Default display extender plugin; does nothing.
DefaultExceptionHtmlSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php Exception subscriber for handling core default HTML error pages. 1 2
DefaultExceptionSubscriber class Drupal\serialization\EventSubscriber core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php Handles default error responses in serialization formats. 1 2 2
DefaultExceptionSubscriber class Drupal\jsonapi\EventSubscriber core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php Serializes exceptions in compliance with the JSON:API specification. 2
DefaultExceptionSubscriberTest class Drupal\Tests\serialization\Unit\EventSubscriber core/modules/serialization/tests/src/Unit/EventSubscriber/DefaultExceptionSubscriberTest.php @coversDefaultClass \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber @group serialization
DefaultFactory class Drupal\Component\Plugin\Factory core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php Default plugin factory. 2 13
DefaultFactoryTest class Drupal\Tests\Component\Plugin core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php @coversDefaultClass \Drupal\Component\Plugin\Factory\DefaultFactory @group Plugin
DefaultFetcher class Drupal\aggregator\Plugin\aggregator\fetcher core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php Defines a default fetcher implementation. 1 1
DefaultFileFormatter class Drupal\file\Plugin\Field\FieldFormatter core/modules/file/src/Plugin/Field/FieldFormatter/DefaultFileFormatter.php Formatter for a text field on a file entity that links the field to the file.
DefaultFormatTest class Drupal\FunctionalTests\Routing core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php @group routing
DefaultFormatTestController class Drupal\default_format_test core/modules/system/tests/modules/default_format_test/src/DefaultFormatTestController.php
DefaultHtmlRouteProvider class Drupal\Core\Entity\Routing core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php Provides HTML routes for entities. 2 1

Other projects


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