Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
TestThemeThemeHooks class Drupal\test_theme_theme\Hook core/modules/system/tests/themes/test_theme_theme/src/Hook/TestThemeThemeHooks.php Hook implementations for test_theme_theme.
TestTime class Drupal\update_test\Datetime core/modules/update/tests/modules/update_test/src/Datetime/TestTime.php Test service for altering the request time. 2
TestTime class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/StageConflictTest.php A test-only implementation of the time service.
TestTime class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspacePublisherTest.php A test-only implementation of the time service.
TestToolkit class Drupal\image_test\Plugin\ImageToolkit core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php Defines a Test toolkit for image manipulation within Drupal. 2
TestTrait trait Drupal\Tests\system\Traits core/modules/system/tests/src/Traits/TestTrait.php A nothing trait, but declared in the Drupal\Tests namespace. 1
TestTranslation class Drupal\media_test_source\Plugin\media\Source core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestTranslation.php Provides test media source.
TestTranslationManager class Drupal\Tests\Core\StringTranslation core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php A chained translation implementation used for testing.
TestType class Drupal\workflow_type_test\Plugin\WorkflowType core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/TestType.php Test workflow type. 4
TestUrl class Drupal\Tests\Core core/tests/Drupal/Tests/Core/UrlTest.php URL information holder with overridden access manager for testing.
TestValidatedReferenceConstraint class Drupal\entity_test\Plugin\Validation\Constraint core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/TestValidatedReferenceConstraint.php Validates referenced entities.
TestValidatedReferenceConstraintValidator class Drupal\entity_test\Plugin\Validation\Constraint core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/TestValidatedReferenceConstraintValidator.php Validates referenced entities.
TestViewListBuilder class Drupal\Tests\views_ui\Unit core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php Stub class for testing ViewListBuilder methods.
TestViewsLocalTask class Drupal\Tests\views\Unit\Plugin\Derivative core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php Replaces the applicable views call for easier testability.
TestViewsTest class Drupal\Tests\views\Kernel core/modules/views/tests/src/Kernel/TestViewsTest.php Tests that test views provided by all modules match schema.
TestWaitTerminateMiddleware class Drupal\Core\Test\StackMiddleware core/lib/Drupal/Core/Test/StackMiddleware/TestWaitTerminateMiddleware.php Acquire a lock to signal request termination to the test runner.
TestWithConstraints class Drupal\media_test_source\Plugin\media\Source core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestWithConstraints.php Provides generic media type.
TestWithHiddenSourceField class Drupal\media_test_source\Plugin\media\Source core/modules/media/tests/modules/media_test_source/src/Plugin/media/Source/TestWithHiddenSourceField.php Provides test media source.
TestWorkspaceNegotiator class Drupal\workspace_update_test\Negotiator core/modules/workspaces/tests/modules/workspace_update_test/src/Negotiator/TestWorkspaceNegotiator.php Defines a workspace negotiator used for testing. 2
TestWorkspaceProvider class Drupal\workspaces_test\Provider core/modules/workspaces/tests/modules/workspaces_test/src/Provider/TestWorkspaceProvider.php Defines a test workspace provider.
TestXssBlock class Drupal\block_test\Plugin\Block core/modules/block/tests/modules/block_test/src/Plugin/Block/TestXssBlock.php Provides a block containing an XSS payload.
TestYamlRouteDiscovery class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php Extends the core route builder with a setter method for the YAML discovery.
Text class Drupal\views\Plugin\views\area core/modules/views/src/Plugin/views/area/Text.php Views area text handler.
Textarea class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Textarea.php Provides a form element for input of multiple-line text. 1
Textarea class Drupal\config_translation\FormElement core/modules/config_translation/src/FormElement/Textarea.php Defines the textarea element for the configuration translation interface.
TextareaTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/TextareaTest.php Tests the form API textarea element.
TextareaTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/TextareaTest.php Tests Drupal\Core\Render\Element\Textarea.
TextareaWidget class Drupal\text\Plugin\Field\FieldWidget core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php Plugin implementation of the 'text_textarea' widget. 1
TextareaWithSummaryTest class Drupal\Tests\text\FunctionalJavascript core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php Tests the JavaScript functionality of the text_textarea_with_summary widget.
TextareaWithSummaryTest class Drupal\Tests\text\Functional core/modules/text/tests/src/Functional/TextareaWithSummaryTest.php Tests the functionality of the text_textarea_with_summary widget.
TextareaWithSummaryWidget class Drupal\text\Plugin\Field\FieldWidget core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php Plugin implementation of the 'text_textarea_with_summary' widget.
TextCustom class Drupal\views\Plugin\views\area core/modules/views/src/Plugin/views/area/TextCustom.php Views area text handler.
TextDefaultFormatter class Drupal\text\Plugin\Field\FieldFormatter core/modules/text/src/Plugin/Field/FieldFormatter/TextDefaultFormatter.php Plugin implementation of the 'text_default' formatter.
TextEditorObjectDependentValidatorTrait trait Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/TextEditorObjectDependentValidatorTrait.php Some CKEditor 5 constraint validators need a Text Editor object.
TextField class Drupal\text\Plugin\migrate\field\d6 core/modules/text/src/Plugin/migrate/field/d6/TextField.php MigrateField Plugin for Drupal 6 text fields. 1
TextField class Drupal\text\Plugin\migrate\field\d7 core/modules/text/src/Plugin/migrate/field/d7/TextField.php Migrate field plugin for Drupal 7 text fields. 1
Textfield class Drupal\config_translation\FormElement core/modules/config_translation/src/FormElement/Textfield.php Defines the textfield element for the configuration translation interface.
Textfield class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Textfield.php Provides a one-line text field form element. 3 2
TextFieldItemList class Drupal\text\Plugin\Field\FieldType core/modules/text/src/Plugin/Field/FieldType/TextFieldItemList.php Defines an item list class for text fields. 1
TextFieldItemListTest class Drupal\Tests\text\Unit\Plugin\Field\FieldType core/modules/text/tests/src/Unit/Plugin/Field/FieldType/TextFieldItemListTest.php Tests TextFieldItemList.
TextFieldTest class Drupal\Tests\text\Unit\Plugin\migrate\field\d6 core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php Tests Drupal\text\Plugin\migrate\field\d6\TextField.
TextFieldTest class Drupal\Tests\text\Unit\Plugin\migrate\field\d7 core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php Tests Drupal\text\Plugin\migrate\field\d7\TextField.
TextFieldTest class Drupal\Tests\text\Functional core/modules/text/tests/src/Functional/TextFieldTest.php Tests the creation of text fields.
TextfieldTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php Tests Drupal\Core\Render\Element\Textfield.
TextfieldWidget class Drupal\text\Plugin\Field\FieldWidget core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php Plugin implementation of the 'text_textfield' widget. 1 1
TextFormat class Drupal\config_translation\FormElement core/modules/config_translation/src/FormElement/TextFormat.php Defines the text_format element for the configuration translation interface.
TextFormat class Drupal\filter\Element core/modules/filter/src/Element/TextFormat.php Provides a text format render element.
TextFormatElementFormTest class Drupal\Tests\filter\Kernel core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php Tests PathElement validation and conversion functionality.
TextFormatterTest class Drupal\Tests\text\Kernel core/modules/text/tests/src/Kernel/TextFormatterTest.php Tests the text formatters functionality.
TextHooks class Drupal\text\Hook core/modules/text/src/Hook/TextHooks.php Hook implementations for text.

Other projects


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