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
TestTasksSettingsSub1 class Drupal\menu_test\Plugin\Menu\LocalTask core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php 1
TestTaskWithUserInput class Drupal\menu_test\Plugin\Menu\LocalTask core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTaskWithUserInput.php 1
TestTestDatabase class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php Stub class supports TestDatabaseTest::testConstructorNullPrefix().
TestTextfieldWidget class Drupal\field_plugins_test\Plugin\Field\FieldWidget core/modules/field/tests/modules/field_plugins_test/src/Plugin/Field/FieldWidget/TestTextfieldWidget.php Plugin implementation of the 'field_plugins_test_text_widget' widget.
TestTextTrimmedFormatter class Drupal\field_plugins_test\Plugin\Field\FieldFormatter core/modules/field/tests/modules/field_plugins_test/src/Plugin/Field/FieldFormatter/TestTextTrimmedFormatter.php Plugin implementation of the 'field_plugins_test_text_formatter' formatter.
TestThemeEngineExtensionList class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php Test theme engine extension list class.
TestThemeExtensionList class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php Test theme extension list class.
TestThemeNegotiator class Drupal\menu_test\Theme core/modules/system/tests/modules/menu_test/src/Theme/TestThemeNegotiator.php Tests the theme negotiation functionality. 2
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
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
TestTranslationManager class Drupal\Tests\user\Unit core/modules/user/tests/src/Unit/PermissionHandlerTest.php Implements a translation manager in tests.
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
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.
TestVarDumper class Drupal\TestTools core/tests/Drupal/TestTools/TestVarDumper.php Provides handlers for the Symfony VarDumper to work within tests. 3
TestViewListBuilder class Drupal\Tests\views_ui\Unit core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
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.
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.
TestWithDispatcher class Drupal\Tests\Component\EventDispatcher core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php
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
TestXSSTitleBlock class Drupal\block_test\Plugin\Block core/modules/block/tests/modules/block_test/src/Plugin/Block/TestXSSTitleBlock.php Provides a block to test XSS in title.
Text class Drupal\views\Plugin\views\area core/modules/views/src/Plugin/views/area/Text.php Views area text handler.
Textarea class Drupal\config_translation\FormElement core/modules/config_translation/src/FormElement/Textarea.php Defines the textarea element for the configuration translation interface.
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
TextareaTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/TextareaTest.php @coversDefaultClass \Drupal\Core\Render\Element\Textarea[[api-linebreak]] @group Render
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.
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. 1
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\Core\Render\Element core/lib/Drupal/Core/Render/Element/Textfield.php Provides a one-line text field form element. 3 3
TextField class Drupal\text\Plugin\migrate\field\d6 core/modules/text/src/Plugin/migrate/field/d6/TextField.php Plugin annotation @MigrateField( id = "d6_text", type_map = { "text" = "text", "text_long" = "text_long", "text_with_summary" = "text_with_summary" }, core = {6}, source_module = "text", destination_module = "text", ) 2
TextField class Drupal\text\Plugin\migrate\field\d7 core/modules/text/src/Plugin/migrate/field/d7/TextField.php Plugin annotation @MigrateField( id = "d7_text", type_map = { "text" = "text", "text_long" = "text_long", "text_with_summary" = "text_with_summary" }, core = {7}, source_module = "text", destination_module = "text", ) 1
Textfield class Drupal\config_translation\FormElement core/modules/config_translation/src/FormElement/Textfield.php Defines the textfield element for the configuration translation interface.
TextFieldRdfaTest class Drupal\Tests\rdf\Kernel\Field core/modules/rdf/tests/src/Kernel/Field/TextFieldRdfaTest.php Tests RDFa output by text field formatters.
TextfieldTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php @coversDefaultClass \Drupal\Core\Render\Element\Textfield[[api-linebreak]] @group Render
TextFieldTest class Drupal\Tests\text\Unit\Migrate\d7 core/modules/text/tests/src/Unit/Migrate/d7/TextFieldTest.php @coversDefaultClass \Drupal\text\Plugin\migrate\field\d7\TextField[[api-linebreak]] @group text
TextFieldTest class Drupal\Tests\text\Unit\Migrate\d6 core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php @coversDefaultClass \Drupal\text\Plugin\migrate\field\d6\TextField[[api-linebreak]] @group text 1 1
TextFieldTest class Drupal\Tests\text\Unit\Plugin\migrate\field\d7 core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php @coversDefaultClass \Drupal\text\Plugin\migrate\field\d7\TextField[[api-linebreak]] @group text
TextFieldTest class Drupal\Tests\text\Unit\Plugin\migrate\field\d6 core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php @coversDefaultClass \Drupal\text\Plugin\migrate\field\d6\TextField[[api-linebreak]] @group text
TextFieldTest class Drupal\Tests\text\Functional core/modules/text/tests/src/Functional/TextFieldTest.php Tests the creation of text fields.
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.

Other projects


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