Classes, traits, and interfaces - 9.5.x - drupal
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 |
---|---|---|---|---|---|---|---|---|
ClassFinderTest | class | Drupal\Tests\Component\ClassFinder | core/ |
@coversDefaultClass \Drupal\Component\ClassFinder\ClassFinder @group ClassFinder | ||||
ClassLoaderTest | class | Drupal\Tests\system\Functional\Module | core/ |
Tests class loading for modules. | ||||
ClassRequiresAvailable | class | Drupal\BuildTests\Framework\Tests | core/ |
@requires externalCommand available_command | ||||
ClassRequiresUnavailable | class | Drupal\BuildTests\Framework\Tests | core/ |
@requires externalCommand unavailable_command | ||||
ClassResolver | class | Drupal\Core\DependencyInjection | core/ |
Implements the class resolver interface supporting class names and services. | 2 | 2 | ||
ClassResolverInterface | interface | Drupal\Core\DependencyInjection | core/ |
Provides interface to get an instance of a class with dependency injection. | 1 | 20 | ||
ClassWithConstants | class | Drupal\Tests\Component\Annotation\Doctrine\Fixtures | core/ |
1 | ||||
ClassWithInvalidAnnotationTargetAtClass | class | Drupal\Tests\Component\Annotation\Doctrine\Fixtures | core/ |
Plugin annotation @AnnotationTargetPropertyMethod("Some data"); | ||||
ClassWithInvalidAnnotationTargetAtMethod | class | Drupal\Tests\Component\Annotation\Doctrine\Fixtures | core/ |
Plugin annotation @AnnotationTargetClass("Some data"); | ||||
ClassWithInvalidAnnotationTargetAtProperty | class | Drupal\Tests\Component\Annotation\Doctrine\Fixtures | core/ |
Plugin annotation @AnnotationTargetClass("Some data"); | ||||
ClassWithValidAnnotationTarget | class | Drupal\Tests\Component\Annotation\Doctrine\Fixtures | core/ |
Plugin annotation @AnnotationTargetClass("Some data"); | ||||
ClassWriter | final class | Drupal\TestTools\PhpUnitCompatibility\PhpUnit8 | core/ |
Helper class to rewrite PHPUnit's TestCase class. | 2 | |||
ClassyPreprocessUnchangedTest | class | Drupal\Tests\Core\Theme | core/ |
Confirms that classy.theme has not added new functionality. | ||||
ClassyTemplatesIdenticalToStableTest | class | Drupal\Tests\Core\Theme | core/ |
Confirms that certain Classy templates have identical equivalents in Stable. | ||||
ClassyTest | class | Drupal\Tests\classy\Kernel | core/ |
Tests the Classy theme. | ||||
ClassyTest | class | Drupal\Tests\classy\Functional | core/ |
Tests the classy theme. | ||||
ClassyUninstallUpdateTest | class | Drupal\Tests\system\Functional\Update | core/ |
Ensures that update hook uninstalls Classy when it's no longer needed. | ||||
ClearTest | class | Drupal\Tests\system\Functional\Cache | core/ |
|||||
ClickSortingAJAXTest | class | Drupal\Tests\views\FunctionalJavascript | core/ |
Tests the click sorting AJAX functionality of Views exposed forms. | ||||
ClientErrorResponseSubscriber | class | Drupal\Core\EventSubscriber | core/ |
Response subscriber to set the '4xx-response' cache tag on 4xx responses. | 2 | |||
ClientFactory | class | Drupal\Core\Http | core/ |
Helper class to construct a HTTP client with Drupal specific config. | 2 | 2 | ||
ClientFactoryTest | class | Drupal\Tests\Core\Http | core/ |
@coversDefaultClass \Drupal\Core\Http\ClientFactory @group Http | ||||
CloseDialogCommand | class | Drupal\Core\Ajax | core/ |
Defines an AJAX command that closes the current active dialog. | 1 | 6 | ||
CloseModalDialogCommand | class | Drupal\Core\Ajax | core/ |
Defines an AJAX command that closes the currently visible modal dialog. | 5 | |||
CollapsedSummariesTest | class | Drupal\Tests\node\FunctionalJavascript | core/ |
Tests that outlines of node meta values are displayed in summaries and tabs. | ||||
CollectRoutesTest | class | Drupal\Tests\rest\Unit | core/ |
Tests the REST export view plugin. | ||||
Color | class | Drupal\color\Plugin\migrate\destination | core/ |
Persist color data to the config system. | 1 | |||
Color | class | Drupal\color\Plugin\migrate\source\d7 | core/ |
Drupal 7 color source from database. | ||||
Color | class | Drupal\Core\Render\Element | core/ |
Provides a form element for choosing a color. | ||||
Color | class | Drupal\Component\Utility | core/ |
Performs color conversions. | 7 | |||
ColorConfigCacheInvalidator | class | Drupal\color\EventSubscriber | core/ |
A subscriber invalidating cache tags when color config objects are saved. | 2 | |||
ColorConfigSchemaTest | class | Drupal\Tests\color\Functional | core/ |
Ensures the color config schema is correct. | ||||
ColorSafePreviewTest | class | Drupal\Tests\color\Functional | core/ |
Tests sanitizing color preview loaded from theme. | ||||
ColorSystemBrandingBlockAlter | class | Drupal\color | core/ |
Provides a trusted callback to alter the system branding block. | 1 | |||
ColorTest | class | Drupal\Tests\color\Kernel\Plugin\migrate\source\d7 | core/ |
Tests D7 color source plugin. | ||||
ColorTest | class | Drupal\Tests\color\Functional | core/ |
Modify theme colors and make sure the changes are reflected on the frontend. | ||||
ColorTest | class | Drupal\Tests\Component\Utility | core/ |
Tests Color utility class conversions. | ||||
Com | class | Drupal\Component\Uuid | core/ |
Generates a UUID using the Windows internal GUID extension. | 1 | |||
Combine | class | Drupal\views\Plugin\views\filter | core/ |
Filter handler which allows to search on multiple fields. | ||||
CommandInterface | interface | Drupal\Core\Ajax | core/ |
AJAX command interface. | 31 | 11 | ||
CommandLineOrUnsafeMethod | class | Drupal\Core\PageCache\RequestPolicy | core/ |
Reject when running from the command line or when HTTP method is not safe. | 2 | |||
CommandLineOrUnsafeMethodTest | class | Drupal\Tests\Core\PageCache | core/ |
@coversDefaultClass \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod @group PageCache | ||||
CommandProvider | class | Drupal\Composer\Plugin\Scaffold | composer/ |
List of all commands provided by this package. | 1 | |||
CommandsTest | class | Drupal\FunctionalJavascriptTests\Ajax | core/ |
Performs tests on AJAX framework commands. | ||||
CommandsTest | class | Drupal\KernelTests\Core\Ajax | core/ |
Performs tests on AJAX framework commands. | ||||
CommandWithAttachedAssetsInterface | interface | Drupal\Core\Ajax | core/ |
Interface for Ajax commands that render content and attach assets. | 4 | |||
CommandWithAttachedAssetsTrait | trait | Drupal\Core\Ajax | core/ |
Trait for Ajax commands that render content and attach assets. | ||||
Comment | class | Drupal\comment\Entity | core/ |
Defines the comment entity class. | 57 | |||
Comment | class | Drupal\comment\Plugin\views\wizard | core/ |
Tests creating comment views with the wizard. | ||||
Comment | class | Drupal\comment\Plugin\migrate\source\d6 | core/ |
Drupal 6 comment source from database. | 1 | 1 |
Pagination
- Previous page
- Page 21
- Next page
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.