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 | 633 | |
Url | class |
Drupal\ |
core/ |
Defines an object that holds information about a URL. | 605 | ||
UnitTestCase | abstract class |
Drupal\ |
core/ |
Provides a base class and helpers for Drupal unit tests. | 590 | 588 | |
AccountInterface | interface |
Drupal\ |
core/ |
Defines an account interface which represents the current user. | 2 | 273 | |
EntityInterface | interface |
Drupal\ |
core/ |
Defines a common interface for all entity objects. | 11 | 264 | |
EntityTypeManagerInterface | interface |
Drupal\ |
core/ |
Provides an interface for entity type managers. | 256 | ||
Views | class |
Drupal\ |
core/ |
Static service container wrapper for views. | 244 | ||
Database | abstract class |
Drupal\ |
core/ |
Primary front-controller for the database system. | 212 | ||
EntityTypeInterface | interface |
Drupal\ |
core/ |
Provides an interface for an entity type and its metadata. | 3 | 199 | |
LanguageInterface | interface |
Drupal\ |
core/ |
Defines an interface for languages. | 2 | 196 | |
RouteMatchInterface | interface |
Drupal\ |
core/ |
Provides an interface for classes representing the result of routing. | 3 | 192 | |
ConfigurableLanguage | class |
Drupal\ |
core/ |
Defines the ConfigurableLanguage entity. | 188 | ||
Row | class |
Drupal\ |
core/ |
Stores a row. | 186 | ||
Node | class |
Drupal\ |
core/ |
Defines the node entity class. | 177 | ||
AccessResult | abstract class |
Drupal\ |
core/ |
Value object for passing an access result with cacheability metadata. | 3 | 163 | |
Cache | class |
Drupal\ |
core/ |
Helper methods for cache. | 155 | ||
NodeType | class |
Drupal\ |
core/ |
Defines the Node type configuration entity. | 153 | ||
FieldStorageDefinitionInterface | interface |
Drupal\ |
core/ |
Defines an interface for entity field storage definitions. | 3 | 150 | |
ModuleHandlerInterface | interface |
Drupal\ |
core/ |
Interface for classes that manage a set of enabled modules. | 1 | 149 | |
EntityTest | class |
Drupal\ |
core/ |
Defines the test entity class. | 37 | 145 | |
WebDriverTestBase | abstract class |
Drupal\ |
core/ |
Runs a browser test using a driver that supports JavaScript. | 149 | 144 | |
XmlEntityNormalizationQuirksTrait | trait |
Drupal\ |
core/ |
Trait for EntityResourceTestBase subclasses testing $format='xml'. | 144 | ||
ContainerBuilder | class |
Drupal\ |
core/ |
Drupal's dependency injection container builder. | 142 | ||
Html | class |
Drupal\ |
core/ |
Provides DOMDocument helpers for parsing and serializing HTML strings. | 141 | ||
FormBase | abstract class |
Drupal\ |
core/ |
Provides a base class for forms. | 142 | 140 | |
CacheableMetadata | class |
Drupal\ |
core/ |
Defines a generic class for passing cacheability metadata. | 2 | 129 | |
StringTranslationTrait | trait |
Drupal\ |
core/ |
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface. | 126 | ||
MigrationInterface | interface |
Drupal\ |
core/ |
Interface for migrations. | 1 | 123 | |
TranslatableMarkup | class |
Drupal\ |
core/ |
Provides translatable markup class. | 2 | 112 | |
ViewsKernelTestBase | abstract class |
Drupal\ |
core/ |
Defines a base class for Views kernel testing. | 123 | 107 | |
EntityStorageInterface | interface |
Drupal\ |
core/ |
Defines the interface for entity storage classes. | 6 | 107 | |
MigrateDrupal6TestBase | abstract class |
Drupal\ |
core/ |
Base class for Drupal 6 migration tests. | 111 | 105 | |
Settings | final class |
Drupal\ |
core/ |
Read only settings that are initialized with the class. | 104 | 2 | |
AnonResourceTestTrait | trait |
Drupal\ |
core/ |
Defines a trait for testing with no authentication provider. | 104 | ||
ConfigFactoryInterface | interface |
Drupal\ |
core/ |
Defines the interface for a configuration object factory. | 1 | 103 | |
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 | ||
CookieResourceTestTrait | trait |
Drupal\ |
core/ |
Trait for ResourceTestBase subclasses testing $auth=cookie. | 97 | ||
RoleInterface | interface |
Drupal\ |
core/ |
Provides an interface defining a user role entity. | 1 | 96 | |
Json | class |
Drupal\ |
core/ |
Default serialization for JSON. | 95 | 3 | |
Role | class |
Drupal\ |
core/ |
Defines the user role entity class. | 95 | ||
Element | class |
Drupal\ |
core/ |
Provides helper methods for Drupal render elements. | 91 | ||
FieldDefinitionInterface | interface |
Drupal\ |
core/ |
Defines an interface for entity field definitions. | 5 | 89 | |
File | class |
Drupal\ |
core/ |
Defines the file entity class. | 88 | ||
NestedArray | class |
Drupal\ |
core/ |
Provides helpers to perform operations on nested arrays and array keys of variable depth. | 86 | ||
CacheBackendInterface | interface |
Drupal\ |
core/ |
Defines an interface for cache implementations. | 5 | 86 | 27 |
FormattableMarkup | class |
Drupal\ |
core/ |
Formats a string for HTML display by replacing variable placeholders. | 1 | 82 | |
BaseFieldDefinition | class |
Drupal\ |
core/ |
A class for defining entity fields. | 2 | 82 | |
Link | class |
Drupal\ |
core/ |
Defines an object that holds information about a link. | 80 |