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 |
---|---|---|---|---|---|---|---|
ArgumentTransformTermTest | class |
Drupal\ |
core/ |
Tests taxonomy term argument transformation. | |||
ArgumentUidRevisionTest | class |
Drupal\ |
core/ |
Tests the argument_node_uid_revision handler. | |||
ArgumentValidateTest | class |
Drupal\ |
core/ |
Tests user argument validators for ID and name. | |||
ArgumentValidatorPluginBase | abstract class |
Drupal\ |
core/ |
Base argument validator plugin to provide basic functionality. | 4 | 1 | |
ArgumentValidatorTermTest | class |
Drupal\ |
core/ |
Tests the plugin of the taxonomy: term argument validator. | |||
ArgumentValidatorTest | class |
Drupal\ |
core/ |
Tests the Argument validator through the UI. | |||
ArgumentValidatorTest | class |
Drupal\ |
core/ |
Tests Views argument validators. | |||
ArgumentValidatorTest | class |
Drupal\ |
core/ |
Defines an argument validator test plugin. | 1 | ||
ArrayBuild | class |
Drupal\ |
core/ |
Builds an array based on the key and value configuration. | 1 | 2 | |
ArrayBuildTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\migrate\Plugin\migrate\process\ArrayBuild @group migrate | |||
ArrayElement | abstract class |
Drupal\ |
core/ |
Defines a generic configuration element that contains multiple properties. | 2 | 1 | |
AssertBlockAppearsTrait | trait |
Drupal\ |
core/ |
Provides test assertions for testing block appearance. | 2 | ||
AssertBreadcrumbTrait | trait |
Drupal\ |
core/ |
Provides test assertions for verifying breadcrumbs. | 4 | ||
AssertButtonsTrait | trait |
Drupal\ |
core/ |
Asserts that buttons are present on a page. | |||
AssertConfigEntityImportTrait | trait |
Drupal\ |
core/ |
Provides test assertions for testing config entity synchronization. | 1 | ||
AssertConfigTrait | trait |
Drupal\ |
core/ |
Trait to help with diffing config. | 4 | ||
AssertContentTrait | trait |
Drupal\ |
core/ |
Provides test methods to assert content. | 1 | ||
AssertContentTraitTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\KernelTests\AssertContentTrait @group Test | |||
AssertHelperTestClass | class |
Drupal\ |
core/ |
A helper class for deprecation of AssertHelperTrait. | |||
AssertHelperTrait Deprecated | trait |
Drupal\ |
core/ |
Provides helper methods for assertions. | |||
AssertHelperTraitTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Tests\AssertHelperTrait @group simpletest @group Tests @group legacy | |||
AssertLegacyTrait Deprecated | trait |
Drupal\ |
core/ |
Provides convenience methods for assertions in browser tests. | 2 | ||
AssertLegacyTrait Deprecated | trait |
Drupal\ |
core/ |
Translates Simpletest assertion methods to PHPUnit. | 1 | ||
AssertLegacyTraitDeprecatedTest | class |
Drupal\ |
core/ |
Tests deprecated AssertLegacyTrait functionality. | |||
AssertLegacyTraitTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\FunctionalTests\AssertLegacyTrait @group Assert @group legacy | |||
AssertMailTrait | trait |
Drupal\ |
core/ |
Provides methods for testing emails sent during test runs. | 14 | ||
AssertMailTraitTest | class |
Drupal\ |
core/ |
Tests \Drupal\Core\Test\AssertMailTrait works. | |||
AssertMenuActiveTrailTrait | trait |
Drupal\ |
core/ |
Provides test assertions for verifying the active menu trail. | |||
AssertPageCacheContextsAndTagsTrait | trait |
Drupal\ |
core/ |
Provides test assertions for testing page-level cache contexts & tags. | 41 | ||
AssertUtilsTrait | trait |
Drupal\ |
core/ |
Convenience class for creating fixtures. | 4 | ||
AssertViewsCacheTagsTrait | trait |
Drupal\ |
core/ |
3 | |||
AssetCollectionGrouperInterface | interface |
Drupal\ |
core/ |
Interface defining a service that logically groups a collection of assets. | 2 | ||
AssetCollectionOptimizerInterface | interface |
Drupal\ |
core/ |
Interface defining a service that optimizes a collection of assets. | 2 | 2 | |
AssetCollectionRendererInterface | interface |
Drupal\ |
core/ |
Interface defining a service that generates a render array to render assets. | 2 | 4 | |
AssetDumper | class |
Drupal\ |
core/ |
Dumps a CSS or JavaScript asset. | 3 | ||
AssetDumperInterface | interface |
Drupal\ |
core/ |
Interface defining a service that dumps an (optimized) asset. | 1 | ||
AssetOptimizerInterface | interface |
Drupal\ |
core/ |
Interface defining a service that optimizes an asset. | 2 | ||
AssetResolver | class |
Drupal\ |
core/ |
The default asset resolver. | 1 | 2 | |
AssetResolverInterface | interface |
Drupal\ |
core/ |
Resolves asset libraries into concrete CSS and JavaScript assets. | 1 | 4 | |
AssetResolverTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Asset\AssetResolver @group Asset | |||
AssignOwnerNode | class |
Drupal\ |
core/ |
Assigns ownership of a node to a user. | |||
AttachedAssets | class |
Drupal\ |
core/ |
The default attached assets collection. | 10 | ||
AttachedAssetsInterface | interface |
Drupal\ |
core/ |
The attached assets collection for the current response. | 1 | 8 | |
AttachedAssetsTest | class |
Drupal\ |
core/ |
Tests #attached assets: attached asset libraries and JavaScript settings. | |||
AttachedRenderingBlock | class |
Drupal\ |
core/ |
A block we can use to test caching of #attached headers. | |||
Attachment | class |
Drupal\ |
core/ |
The plugin that handles an attachment display. | |||
AttachmentsInterface | interface |
Drupal\ |
core/ |
Defines an interface for responses that can expose #attached metadata. | 5 | 11 | |
AttachmentsResponseProcessorInterface | interface |
Drupal\ |
core/ |
Defines an interface for processing attachments of responses that have them. | 2 | 5 | |
AttachmentsTestDomainObject | class |
Drupal\ |
core/ |
||||
AttachmentsTestResponse | class |
Drupal\ |
core/ |