Classes, traits, and interfaces - main - 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 1529
| Name | Deprecated | Object type | Namespace | File name | Summary | Direct uses | Use statements | Strings |
|---|---|---|---|---|---|---|---|---|
| Event | class | Drupal\Component\EventDispatcher | core/ |
Provides a forward-compatibility layer for the Symfony 5 event class. | 31 | 34 | ||
| EventBase | class | Drupal\migrate\Event | core/ |
Base class for migration events. | 2 | 2 | ||
| EventBaseTest | class | Drupal\Tests\migrate\Unit\Event | core/ |
Tests Drupal\migrate\Event\EventBase. | 2 | |||
| EventException | class | Drupal\Core\Database\Exception | core/ |
Exception thrown by the database event API. | 2 | |||
| EventLogSubscriber | final class | Drupal\package_manager_test_event_logger\EventSubscriber | core/ |
Defines an event subscriber to test logging during events in Package Manager. | 1 | 2 | ||
| EventSubscriber | class | Drupal\config_collection_install_test | core/ |
Event subscriber for testing configuration collection. | 2 | |||
| EventSubscriber | class | Drupal\config_events_test | core/ |
Event subscriber for testing configuration events. | 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 | |||
| EventSubscriber | class | Drupal\language_events_test | core/ |
Event subscriber for testing Language events. | 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 | |||
| EventWithPackageListTrait | trait | Drupal\package_manager\Event | core/ |
Common methods for pre- and post-require events. | 1 | |||
| EventWithPackageListTraitTest | class | Drupal\Tests\package_manager\Unit | core/ |
Tests Event With Package List Trait. | ||||
| 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. | ||||
| Example3 | class | Drupal\plugin_test\Plugin\plugin_test\custom_annotation | core/ |
Provides a test plugin with a custom attribute. | ||||
| Example4 | class | Drupal\plugin_test\Plugin\plugin_test\custom_annotation | core/ |
Provides a test plugin with a custom attribute. | ||||
| Example5 | class | Drupal\plugin_test\Plugin\plugin_test\custom_annotation | core/ |
Provides a test plugin with a custom attribute. | ||||
| ExampleAttribute | final class | Drupal\Tests\Component\Annotation\Doctrine\Fixtures\ExtraAttributes | core/ |
#[\Attribute] | 2 | |||
| ExampleParentAttribute | class | Drupal\Tests\Component\Annotation\Doctrine\Fixtures\ExtraAttributes | core/ |
#[\Attribute] | 1 | |||
| ExampleRenderable | class | Drupal\twig_theme_test | core/ |
Provides an example implementation of the RenderableInterface. | ||||
| ExampleWithAttributeAndAnnotation | class | Drupal\plugin_test\Plugin\plugin_test\custom_annotation | core/ |
Provides a test plugin with an annotation and attribute. | ||||
| ExampleWithOtherModuleDependency | class | Drupal\plugin_test\Plugin\plugin_test\custom_annotation | core/ |
Test class with a dependency on another module. | ||||
| 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 | class | Drupal\Core\Database | core/ |
Base Database exception handler class. | 2 | 6 | ||
| ExceptionHandler | class | Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses | core/ |
CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\ExceptionHandler. | ||||
| ExceptionHandler | class | Drupal\mysqli\Driver\Database\mysqli | core/ |
MySQLi database exception handler class. | ||||
| 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/ |
Tests Drupal\Core\EventSubscriber\ExceptionJsonSubscriber. | ||||
| ExceptionLoggingSubscriber | class | Drupal\Core\EventSubscriber | core/ |
Log exceptions without further handling. | 2 | |||
| ExceptionLoggingSubscriberTest | class | Drupal\KernelTests\Core\EventSubscriber | core/ |
Tests that HTTP exceptions are logged correctly. | ||||
| ExceptionStatusCodeCacheContext | class | Drupal\Core\Cache\Context | core/ |
Defines the ExceptionStatusCodeCacheContext service. | 1 | 2 | ||
| ExceptionStatusCodeCacheContextTest | class | Drupal\Tests\Core\Cache\Context | core/ |
Tests Drupal\Core\Cache\Context\CookiesCacheContext. | ||||
| 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 | core/ |
Convenience class for creating fixtures. | 5 | |||
| ExecutableException | class | Drupal\Core\Executable | core/ |
Generic executable plugin exception class. | 1 | |||
| ExecutableFinder | final class | Drupal\package_manager | core/ |
An executable finder which looks for executable paths in configuration. | 2 | |||
| ExecutableFinderTest | class | Drupal\Tests\package_manager\Unit | core/ |
Tests Package Manager's executable finder service. | ||||
| 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 | 6 | ||
| 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\Validation | core/ |
Defines an execution context class. | 2 |
Pagination
- Previous page
- Page 72
- Next page
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.