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 |
---|---|---|---|---|---|---|---|
UnitTestCase | abstract class |
Drupal\ |
core/ |
Provides a base class and helpers for Drupal unit tests. | 590 | 588 | |
WebDriverTestBase | abstract class |
Drupal\ |
core/ |
Runs a browser test using a driver that supports JavaScript. | 149 | 144 | |
FormBase | abstract class |
Drupal\ |
core/ |
Provides a base class for forms. | 142 | 140 | |
ViewsKernelTestBase | abstract class |
Drupal\ |
core/ |
Defines a base class for Views kernel testing. | 123 | 107 | |
MigrateDrupal6TestBase | abstract class |
Drupal\ |
core/ |
Base class for Drupal 6 migration tests. | 111 | 105 | |
MigrateDrupal7TestBase | abstract class |
Drupal\ |
core/ |
Base class for Drupal 7 migration tests. | 103 | 98 | |
MigrateSqlSourceTestBase | abstract class |
Drupal\ |
core/ |
Base class for tests of Migrate source plugins that use a database. | 99 | 98 | |
ViewTestBase | abstract class |
Drupal\ |
core/ |
Defines a base class for Views testing in the full web test environment. | 82 | 67 | |
ContainerInjectionInterface | interface |
Drupal\ |
core/ |
Defines a common interface for dependency container injection. | 75 | 75 | |
ControllerBase | abstract class |
Drupal\ |
core/ |
Utility base class for thin controllers. | 74 | 74 | |
EntityKernelTestBase | abstract class |
Drupal\ |
core/ |
Defines an abstract test base for entity kernel tests. | 72 | 37 | |
DrupalSqlBase | abstract class |
Drupal\ |
core/ |
A base class for source plugins using a Drupal database as a source. | 67 | 65 | |
ContainerFactoryPluginInterface | interface |
Drupal\ |
core/ |
Defines an interface for pulling plugin dependencies from the container. | 59 | 62 | |
UpdatePathTestBase | abstract class |
Drupal\ |
core/ |
Provides a base class for writing an update test. | 48 | 47 | |
CacheableDependencyInterface | interface |
Drupal\ |
core/ |
Defines an interface for objects which may be used by other cached objects. | 47 | 68 | |
UITestBase | abstract class |
Drupal\ |
core/ |
Provides a base class for testing the Views UI. | 44 | 5 | |
Plugin | class |
Drupal\ |
core/ |
Defines a Plugin annotation object. | 42 | 41 | |
PluginBase | abstract class |
Drupal\ |
core/ |
Base class for plugins supporting metadata inspection and translation. | 39 | 38 | |
InstallerTestBase | abstract class |
Drupal\ |
core/ |
Base class for testing the interactive installer. | 39 | 4 | |
DeriverBase | abstract class |
Drupal\ |
core/ |
Provides a basic deriver. | 38 | 38 | |
EntityTest | class |
Drupal\ |
core/ |
Defines the test entity class. | 37 | 145 | |
ContainerDeriverInterface | interface |
Drupal\ |
core/ |
Creates additional plugin definitions. | 36 | 36 | |
ConfigEntityResourceTestBase | abstract class |
Drupal\ |
core/ |
Resource test base class for config entities. | 34 | 35 | |
FormInterface | interface |
Drupal\ |
core/ |
Provides an interface for a Form. | 34 | 34 | |
AccessInterface | interface |
Drupal\ |
core/ |
An access check service determines access rules for particular routes. | 34 | 34 | |
EntityAccessControlHandler | class |
Drupal\ |
core/ |
Defines a default implementation for entity access control handler. | 33 | 34 | |
NodeTestBase | abstract class |
Drupal\ |
core/ |
Sets up page and article content types. | 32 | 3 | |
DatabaseTestBase | abstract class |
Drupal\ |
core/ |
Base class for databases database tests. | 32 | ||
PluginInspectionInterface | interface |
Drupal\ |
core/ |
Plugin interface for providing some metadata inspection. | 32 | 40 | |
ConfigEntityResourceTestBase | abstract class |
Drupal\ |
core/ |
Resource test base class for config entities. | 31 | 2 | |
RenderElementBase | abstract class |
Drupal\ |
core/ |
Provides a base class for render element plugins. | 31 | 15 | |
ConfigEntityInterface | interface |
Drupal\ |
core/ |
Defines a common interface for configuration entities. | 31 | 58 | |
ConfirmFormBase | abstract class |
Drupal\ |
core/ |
Provides a generic base class for a confirmation form. | 28 | 28 | |
FormElementBase | abstract class |
Drupal\ |
core/ |
Provides a base class for form element plugins. | 28 | 3 | |
TrustedCallbackInterface | interface |
Drupal\ |
core/ |
Interface to declare trusted callbacks. | 28 | 27 | |
MigrateProcessTestCase | abstract class |
Drupal\ |
core/ |
27 | 8 | ||
CommandInterface | interface |
Drupal\ |
core/ |
AJAX command interface. | 27 | 7 | |
Event | class |
Drupal\ |
core/ |
Provides a forward-compatibility layer for the Symfony 5 event class. | 25 | 29 | |
FieldItemBase | abstract class |
Drupal\ |
core/ |
An entity field item. | 25 | 27 | |
EntityForm | class |
Drupal\ |
core/ |
Base class for entity forms. | 24 | 23 | |
CommentTestBase | abstract class |
Drupal\ |
core/ |
Provides setup and helper methods for comment tests. | 24 | 2 | |
DatabaseException | interface |
Drupal\ |
core/ |
Interface for a database exception. | 23 | 18 | |
PluginFormInterface | interface |
Drupal\ |
core/ |
Provides an interface for an embeddable plugin form. | 21 | 27 | |
CacheContextInterface | interface |
Drupal\ |
core/ |
Provides an interface for defining a cache context service. | 21 | 6 | |
ConfigEntityBase | abstract class |
Drupal\ |
core/ |
20 | 22 | ||
MigrateTestBase | abstract class |
Drupal\ |
core/ |
Creates abstract base class for migration tests. | 19 | 6 | |
PluginManagerInterface | interface |
Drupal\ |
core/ |
Interface implemented by plugin managers. | 19 | 39 | |
MediaFunctionalTestBase | abstract class |
Drupal\ |
core/ |
Base class for Media functional tests. | 18 | 3 | |
TaxonomyTestBase | abstract class |
Drupal\ |
core/ |
Provides common helper methods for Taxonomy module tests. | 18 | ||
DependentPluginInterface | interface |
Drupal\ |
core/ |
Provides an interface for a plugin that has dependencies. | 18 | 20 |