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 |
---|---|---|---|---|---|---|---|
FormStateInterface | interface |
Drupal\ |
core/ |
Provides an interface for an object containing the current state of a form. | 2 | 650 | |
Url | class |
Drupal\ |
core/ |
Defines an object that holds information about a URL. | 617 | ||
UnitTestCase | abstract class |
Drupal\ |
core/ |
Provides a base class and helpers for Drupal unit tests. | 594 | 592 | |
AccountInterface | interface |
Drupal\ |
core/ |
Defines an account interface which represents the current user. | 2 | 277 | |
EntityInterface | interface |
Drupal\ |
core/ |
Defines a common interface for all entity objects. | 11 | 266 | |
EntityTypeManagerInterface | interface |
Drupal\ |
core/ |
Provides an interface for entity type managers. | 262 | ||
Views | class |
Drupal\ |
core/ |
Static service container wrapper for views. | 250 | ||
Row | class |
Drupal\ |
core/ |
Stores a row. | 217 | ||
Database | abstract class |
Drupal\ |
core/ |
Primary front-controller for the database system. | 214 | ||
LanguageInterface | interface |
Drupal\ |
core/ |
Defines an interface for languages. | 2 | 203 | |
ConfigurableLanguage | class |
Drupal\ |
core/ |
Defines the ConfigurableLanguage entity. | 200 | ||
EntityTypeInterface | interface |
Drupal\ |
core/ |
Provides an interface for an entity type and its metadata. | 3 | 200 | |
RouteMatchInterface | interface |
Drupal\ |
core/ |
Provides an interface for classes representing the result of routing. | 3 | 196 | |
Node | class |
Drupal\ |
core/ |
Defines the node entity class. | 182 | ||
AccessResult | abstract class |
Drupal\ |
core/ |
Value object for passing an access result with cacheability metadata. | 3 | 166 | |
Cache | class |
Drupal\ |
core/ |
Helper methods for cache. | 162 | ||
NodeType | class |
Drupal\ |
core/ |
Defines the Node type configuration entity. | 158 | ||
FieldStorageDefinitionInterface | interface |
Drupal\ |
core/ |
Defines an interface for entity field storage definitions. | 3 | 152 | |
ModuleHandlerInterface | interface |
Drupal\ |
core/ |
Interface for classes that manage a set of enabled modules. | 1 | 150 | |
Html | class |
Drupal\ |
core/ |
Provides DOMDocument helpers for parsing and serializing HTML strings. | 146 | ||
WebDriverTestBase | abstract class |
Drupal\ |
core/ |
Runs a browser test using a driver that supports JavaScript. | 150 | 145 | |
ContainerBuilder | class |
Drupal\ |
core/ |
Drupal's dependency injection container builder. | 144 | ||
XmlEntityNormalizationQuirksTrait | trait |
Drupal\ |
core/ |
Trait for EntityResourceTestBase subclasses testing $format='xml'. | 144 | ||
EntityTest | class |
Drupal\ |
core/ |
Defines the test entity class. | 35 | 143 | |
FormBase | abstract class |
Drupal\ |
core/ |
Provides a base class for forms. | 144 | 142 | |
MigrationInterface | interface |
Drupal\ |
core/ |
Interface for migrations. | 1 | 138 | |
CacheableMetadata | class |
Drupal\ |
core/ |
Defines a generic class for passing cacheability metadata. | 2 | 130 | |
StringTranslationTrait | trait |
Drupal\ |
core/ |
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface. | 127 | ||
TranslatableMarkup | class |
Drupal\ |
core/ |
Provides translatable markup class. | 2 | 112 | |
ViewsKernelTestBase | abstract class |
Drupal\ |
core/ |
Defines a base class for Views kernel testing. | 127 | 111 | |
Settings | final class |
Drupal\ |
core/ |
Read only settings that are initialized with the class. | 109 | 2 | |
EntityStorageInterface | interface |
Drupal\ |
core/ |
Defines the interface for entity storage classes. | 6 | 109 | |
ConfigFactoryInterface | interface |
Drupal\ |
core/ |
Defines the interface for a configuration object factory. | 1 | 108 | |
MigrateDrupal6TestBase | abstract class |
Drupal\ |
core/ |
Base class for Drupal 6 migration tests. | 111 | 105 | |
AnonResourceTestTrait | trait |
Drupal\ |
core/ |
Defines a trait for testing with no authentication provider. | 104 | ||
RoleInterface | interface |
Drupal\ |
core/ |
Provides an interface defining a user role entity. | 1 | 99 | |
MigrateSqlSourceTestBase | abstract class |
Drupal\ |
core/ |
Base class for tests of Migrate source plugins that use a database. | 99 | 98 | |
MigrateDrupal7TestBase | abstract class |
Drupal\ |
core/ |
Base class for Drupal 7 migration tests. | 103 | 98 | |
BasicAuthResourceTestTrait | trait |
Drupal\ |
core/ |
Trait for ResourceTestBase subclasses testing $auth=basic_auth. | 98 | ||
FormattableMarkup | class |
Drupal\ |
core/ |
Formats a string for HTML display by replacing variable placeholders. | 1 | 97 | |
Role | class |
Drupal\ |
core/ |
Defines the user role entity class. | 97 | ||
CookieResourceTestTrait | trait |
Drupal\ |
core/ |
Trait for ResourceTestBase subclasses testing $auth=cookie. | 97 | ||
Json | class |
Drupal\ |
core/ |
Default serialization for JSON. | 96 | 3 | |
File | class |
Drupal\ |
core/ |
Defines the file entity class. | 95 | ||
Element | class |
Drupal\ |
core/ |
Provides helper methods for Drupal render elements. | 92 | ||
MigrateExecutableInterface | interface |
Drupal\ |
core/ |
1 | 91 | ||
FieldDefinitionInterface | interface |
Drupal\ |
core/ |
Defines an interface for entity field definitions. | 5 | 91 | |
NestedArray | class |
Drupal\ |
core/ |
Provides helpers to perform operations on nested arrays and array keys of variable depth. | 90 | ||
CacheBackendInterface | interface |
Drupal\ |
core/ |
Defines an interface for cache implementations. | 5 | 88 | 27 |
BaseFieldDefinition | class |
Drupal\ |
core/ |
A class for defining entity fields. | 2 | 87 |