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 |
---|---|---|---|---|---|---|---|---|
ErrorTestController | class | Drupal\error_test\Controller | core/ |
Controller routines for error_test routes. | 1 | |||
Event | class | Drupal\Component\EventDispatcher | core/ |
Provides a forward-compatibility layer for the Symfony 5 event class. | 27 | 31 | ||
EventBase | class | Drupal\migrate\Event | core/ |
2 | 2 | |||
EventBaseTest | class | Drupal\Tests\migrate\Unit\Event | core/ |
@coversDefaultClass \Drupal\migrate\Event\EventBase @group migrate | 2 | |||
EventSubscriber | class | Drupal\module_install_class_loader_test1 | core/ |
Defines an event subscriber that conditionally unsets the event list. | 2 | |||
EventSubscriber | class | Drupal\module_install_class_loader_test2 | core/ |
An event subscriber that does nothing. | 2 | |||
EventSubscriber | class | Drupal\config_collection_install_test | core/ |
2 | ||||
EventSubscriber | class | Drupal\config_events_test | core/ |
2 | ||||
EventSubscriber | class | Drupal\config_transformer_test | core/ |
Class EventSubscriber. | 2 | |||
EventSubscriber | class | Drupal\config_import_test | core/ |
Config import subscriber for config import events. | 2 | |||
Example1 | class | Drupal\plugin_test\Plugin\plugin_test\custom_annotation | core/ |
Provides a test plugin with a custom annotation. | ||||
Example2 | class | Drupal\plugin_test\Plugin\plugin_test\custom_annotation | core/ |
Provides a test plugin with a custom annotation. | ||||
ExampleRenderable | class | Drupal\twig_theme_test | core/ |
Provides an example implementation of the RenderableInterface. | ||||
ExceptionContainer | class | Drupal\FunctionalTests\Bootstrap | core/ |
Base container which throws an exception. | ||||
ExceptionDetectNeedsInstallSubscriber | class | Drupal\Core\EventSubscriber | core/ |
Exception handler to determine if an exception indicates an uninstalled site. | 2 | |||
ExceptionHandler | in drupal:9.4.0 and is removed from drupal:11.0.0. The MySQL database driver has been moved to the mysql module. |
class | Drupal\Core\Database\Driver\mysql | core/ |
MySql database exception handler class. | 1 | ||
ExceptionHandler | class | Drupal\Core\Database | core/ |
Base Database exception handler class. | 2 | 2 | ||
ExceptionHandler | class | Drupal\corefake\Driver\Database\corefakeWithAllCustomClasses | core/ |
CorefakeWithAllCustomClasses implementation of \Drupal\Core\Database\ExceptionHandler. | ||||
ExceptionHandler | class | Drupal\mysql\Driver\Database\mysql | core/ |
MySql database exception handler class. | 1 | 1 | ||
ExceptionHandlingTest | class | Drupal\KernelTests\Core\Routing | core/ |
Tests the exception handling for various cases. | ||||
ExceptionInterface | interface | Drupal\Component\Plugin\Exception | core/ |
Exception interface for all exceptions thrown by the Plugin component. | 5 | 2 | ||
ExceptionJsonSubscriber | class | Drupal\Core\EventSubscriber | core/ |
Default handling for JSON errors. | 1 | 2 | ||
ExceptionJsonSubscriberTest | class | Drupal\Tests\Core\EventSubscriber | core/ |
@coversDefaultClass \Drupal\Core\EventSubscriber\ExceptionJsonSubscriber @group EventSubscriber | ||||
ExceptionLoggingSubscriber | class | Drupal\Core\EventSubscriber | core/ |
Log exceptions without further handling. | 2 | |||
ExcludedFieldTokenTest | class | Drupal\Tests\rest\Functional\Views | core/ |
Tests the display of an excluded field that is used as a token. | ||||
ExcludedModulesEventSubscriber | final class | Drupal\Core\EventSubscriber | core/ |
The event subscriber preventing excluded modules to be exported. | 2 | |||
ExcludedModulesEventSubscriberTest | class | Drupal\KernelTests\Core\Config | core/ |
Tests ExcludedModulesEventSubscriber. | ||||
ExecTrait | trait | Drupal\Tests\Composer\Plugin\Scaffold | core/ |
Convenience class for creating fixtures. | 3 | |||
ExecutableException | class | Drupal\Core\Executable | core/ |
Generic executable plugin exception class. | 1 | |||
ExecutableInterface | interface | Drupal\Core\Executable | core/ |
An interface for executable plugins. | 3 | 3 | ||
ExecutableManagerInterface | interface | Drupal\Core\Executable | core/ |
An interface for managers of executable plugins. | 1 | 4 | ||
ExecutablePluginBase | abstract class | Drupal\Core\Executable | core/ |
Provides the basic architecture for executable plugins. | 1 | 1 | ||
ExecuteMigration | class | Drupal\migrate_no_migrate_drupal_test\Controller | core/ |
Custom controller to execute the test migrations. | ||||
ExecutionContext | class | Drupal\Core\TypedData\Validation | core/ |
Defines an execution context class. | 1 | |||
ExecutionContextFactory | class | Drupal\Core\TypedData\Validation | core/ |
Defines an execution factory for the Typed Data validator. | 2 | |||
ExistingDrupal8StyleDatabaseConnectionInSettingsPhpTest | class | Drupal\FunctionalTests | core/ |
@group Database | ||||
ExpectDeprecationTest | class | Drupal\Tests | core/ |
@coversDefaultClass \Drupal\Tests\Traits\ExpectDeprecationTrait | ||||
ExpectDeprecationTrait | in drupal:9.1.0 and is removed from drupal:10.0.0. Use \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait instead. |
trait | Drupal\Tests\Traits | core/ |
Adds the ability to dynamically set expected deprecation messages in tests. | 2 | ||
ExperimentalHelpTest | class | Drupal\Tests\help\Functional | core/ |
Verifies help for experimental modules. | ||||
ExperimentalThemeTest | class | Drupal\Tests\system\Functional\Theme | core/ |
Tests the installation of experimental themes. | ||||
Explode | class | Drupal\migrate\Plugin\migrate\process | core/ |
Splits the source string into an array of strings, using a delimiter. | 1 | |||
ExplodeTest | class | Drupal\Tests\migrate\Unit\process | core/ |
Tests the Explode process plugin. | ||||
ExportForm | class | Drupal\locale\Form | core/ |
Form for the Gettext translation files export form. | 1 | |||
ExportStorageManager | final class | Drupal\Core\Config | core/ |
The export storage manager dispatches an event for the export storage. | 1 | 2 | ||
ExportStorageManagerTest | class | Drupal\KernelTests\Core\Config | core/ |
Tests the export storage manager. | ||||
ExposedFilterAJAXTest | class | Drupal\Tests\views\FunctionalJavascript | core/ |
Tests the basic AJAX functionality of Views exposed forms. | ||||
ExposedFormCache | class | Drupal\views | core/ |
Caches exposed forms, as they are heavy to generate. | 1 | 2 | ||
ExposedFormCheckboxesTest | class | Drupal\Tests\views\Functional\Plugin | core/ |
Tests exposed forms functionality. | ||||
ExposedFormPluginBase | abstract class | Drupal\views\Plugin\views\exposed_form | core/ |
Base class for Views exposed filter form plugins. | 2 | |||
ExposedFormPluginInterface | interface | Drupal\views\Plugin\views\exposed_form | core/ |
Interface for exposed filter form plugins. | 1 | 1 |
Pagination
- Previous page
- Page 62
- Next page
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.