Classes, traits, and interfaces in Drupal 9
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
|
Name |
Type | Namespace | Location | Description | Direct uses | Use statements | Strings |
|---|---|---|---|---|---|---|---|
| CommentTypeRequirementsTest | class |
Drupal\ |
core/ |
Tests check requirements for comment type source plugin. | |||
| CommentTypeResourceTestBase | abstract class |
Drupal\ |
core/ |
ResourceTestBase for CommentType entity. | 9 | 3 | |
| CommentTypeTest | class |
Drupal\ |
core/ |
JSON:API integration test for the "CommentType" config entity type. | |||
| CommentTypeTest | class |
Drupal\ |
core/ |
Ensures that comment type functions work correctly. | |||
| CommentTypeTest | class |
Drupal\ |
core/ |
Tests the comment type source plugin. | |||
| CommentTypeXmlAnonTest | class |
Drupal\ |
core/ |
@group rest | |||
| CommentTypeXmlBasicAuthTest | class |
Drupal\ |
core/ |
@group rest | |||
| CommentTypeXmlCookieTest | class |
Drupal\ |
core/ |
@group rest | |||
| CommentUninstallTest | class |
Drupal\ |
core/ |
Tests comment module uninstall. | |||
| CommentUserNameTest | class |
Drupal\ |
core/ |
Tests comment user name field. | |||
| CommentValidationTest | class |
Drupal\ |
core/ |
Tests comment validation constraints. | |||
| CommentViewBuilder | class |
Drupal\ |
core/ |
View builder handler for comments. | |||
| CommentViewsData | class |
Drupal\ |
core/ |
Provides views data for the comment entity type. | |||
| CommentViewsFieldAccessTest | class |
Drupal\ |
core/ |
Tests base field access in Views for the comment entity. | |||
| CommentViewsKernelTestBase | abstract class |
Drupal\ |
core/ |
Provides a common test base for comment views tests. | 2 | ||
| CommentWidget | class |
Drupal\ |
core/ |
Provides a default comment widget. | |||
| CommentXmlAnonTest | class |
Drupal\ |
core/ |
@group rest | |||
| CommentXmlBasicAuthTest | class |
Drupal\ |
core/ |
@group rest | |||
| CommentXmlCookieTest | class |
Drupal\ |
core/ |
@group rest | |||
| CommonCollectionFilterAccessTestPatternsTrait | trait |
Drupal\ |
core/ |
Provides common filter access control tests. | 9 | ||
| CommonDataConverter | class |
Drupal\ |
core/ |
Contains methods for common data conversions. | |||
| CommonTestController | class |
Drupal\ |
core/ |
Controller routines for common_test routes. | |||
| CompiledRoute | class |
Drupal\ |
core/ |
A compiled route contains derived information from a route object. | 1 | ||
| CompiledRouteLegacyTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Routing\CompiledRoute @group Routing @group legacy | |||
| ComplexDataConstraint | class |
Drupal\ |
core/ |
Complex data constraint. | |||
| ComplexDataConstraintValidator | class |
Drupal\ |
core/ |
Validates complex data. | |||
| ComplexDataConstraintValidatorTest | class |
Drupal\ |
core/ |
Tests ComplexData validation constraint with both valid and invalid values for a key. | |||
| ComplexDataDefinitionBase | abstract class |
Drupal\ |
core/ |
Base class for complex data definitions. | 2 | 1 | |
| ComplexDataDefinitionInterface | interface |
Drupal\ |
core/ |
Interface for complex data definitions. | 3 | 8 | |
| ComplexDataInterface | interface |
Drupal\ |
core/ |
Interface for complex data; i.e. data containing named and typed properties. | 4 | 15 | |
| ComplexDataNormalizer | class |
Drupal\ |
core/ |
Converts the Drupal entity object structures to a normalized array. | 3 | 1 | 2 |
| ComplexDataNormalizerTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\serialization\Normalizer\ComplexDataNormalizer @group serialization | |||
| ComplexTestType | class |
Drupal\ |
core/ |
Test workflow type. | |||
| ComplexTestTypeConfigureForm | class |
Drupal\ |
core/ |
Form to configure the complex test workflow type. | |||
| ComplexTestTypeStateForm | class |
Drupal\ |
core/ |
Form to configure the complex test workflow states. | |||
| ComplexTestTypeTransitionForm | class |
Drupal\ |
core/ |
Form to configure the complex test workflow states. | |||
| ComplexWorkflowTypeTest | class |
Drupal\ |
core/ |
Workflow entity tests that require modules or storage. | |||
| ComponentEntityDisplayBase | abstract class |
Drupal\ |
core/ |
Provides a destination plugin for migrating entity display components. | 3 | 2 | |
| Composer | class |
Drupal\ |
composer/ |
Provides static functions for composer script events. See also core/lib/Drupal/Composer/Composer.php, which contains similar scripts needed by projects that include drupal/core. Scripts that are only needed by drupal/drupal go here. | 5 | ||
| Composer | class |
Drupal\ |
core/ |
Provides static functions for composer script events. | 1 | ||
| ComposerHookTest | class |
Drupal\ |
core/ |
Tests Composer Hooks that run scaffold operations. | |||
| ComposerIntegrationTest | class |
Drupal\ |
core/ |
Tests Composer integration. | |||
| ComposerIntegrationTrait | trait |
Drupal\ |
core/ |
Some utility functions for testing the Composer integration. | 2 | ||
| ComposerProjectTemplatesTest | class |
Drupal\ |
core/ |
Demonstrate that Composer project templates are buildable as patched. | |||
| ComposerScaffoldCommand | class |
Drupal\ |
composer/ |
The "drupal:scaffold" command class. | |||
| ComposerTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Composer\Composer @group Composer | |||
| ComposerValidateTest | class |
Drupal\ |
core/ |
@group Composer @requires externalCommand composer | |||
| CompositeConstraintBase | abstract class |
Drupal\ |
core/ |
Provides a base class for constraints validating multiple fields. | 4 | 6 | |
| CompositeFormElementTrait | trait |
Drupal\ |
core/ |
Provides a trait for radios, checkboxes, and similar composite form elements. | |||
| ComputedFieldTest | class |
Drupal\ |
core/ |
Provides some integration tests for the Field handler. |