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 usessort ascending Use statements Strings
EntityActionDeriverBase abstract class Drupal\Core\Action\Plugin\Action\Derivative core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityActionDeriverBase.php Provides a base action for each entity type with specific interfaces. 3
FieldInstance class Drupal\field\Plugin\migrate\source\d7 core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php Drupal 7 field instances source from database. 3 1
Tasks class Drupal\pgsql\Driver\Database\pgsql\Install core/modules/pgsql/src/Driver/Database/pgsql/Install/Tasks.php Specifies installation tasks for PostgreSQL databases. 3 3
EntityTestMul class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMul.php Defines the test entity class. 3 9
MigrateDrupalTestBase abstract class Drupal\Tests\tracker\Kernel\Migrate\d7 core/modules/tracker/tests/src/Kernel/Migrate/d7/MigrateDrupalTestBase.php Base class for Tracker Drupal 7 migration tests. 3
TermTest class Drupal\Tests\taxonomy\Kernel\Plugin\migrate\source\d7 core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d7/TermTest.php Tests taxonomy term source plugin. 3
MediaTestBase abstract class Drupal\Tests\ckeditor5\FunctionalJavascript core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTestBase.php Base class for CKEditor 5 Media integration tests. 3
ConfigTranslationUiTestBase abstract class Drupal\Tests\config_translation\Functional core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTestBase.php Translate settings and entities to various languages. 3
SectionStorageInterface interface Drupal\layout_builder core/modules/layout_builder/src/SectionStorageInterface.php Defines an interface for Section Storage type plugins. 3 34
MediaSourceInterface interface Drupal\media core/modules/media/src/MediaSourceInterface.php Defines the interface for media source plugins. 3 1 1
TestSetupInterface interface Drupal\TestSite core/tests/Drupal/TestSite/TestSetupInterface.php Allows setting up an environment as part of a test site install. 3
AnnotationInterface interface Drupal\Component\Annotation core/lib/Drupal/Component/Annotation/AnnotationInterface.php Defines a common interface for classed annotations. 3 4
PoWriterInterface interface Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoWriterInterface.php Shared interface definition for all Gettext PO Writers. 3 1
UuidInterface interface Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/UuidInterface.php Interface for generating UUIDs. 3 11
AccessResultInterface interface Drupal\Core\Access core/lib/Drupal/Core/Access/AccessResultInterface.php Interface for access result value objects. 3 14
CommandWithAttachedAssetsInterface interface Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsInterface.php Interface for Ajax commands that render content and attach assets. 3
AssetCollectionOptimizerInterface interface Drupal\Core\Asset core/lib/Drupal/Core/Asset/AssetCollectionOptimizerInterface.php Interface defining a service that optimizes a collection of assets. 3 1
CacheCollectorInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/CacheCollectorInterface.php Provides a caching wrapper to be used in place of large structures. 3 2
VariantInterface interface Drupal\Core\Display core/lib/Drupal/Core/Display/VariantInterface.php Provides an interface for DisplayVariant plugins. 3
EntityDescriptionInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityDescriptionInterface.php Defines the interface for entities that have a description. 3 3
EntityTypeInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityTypeInterface.php Provides an interface for an entity type and its metadata. 3 199
ExecutableInterface interface Drupal\Core\Executable core/lib/Drupal/Core/Executable/ExecutableInterface.php An interface for executable plugins. 3 3
ConfigImportModuleUninstallValidatorInterface interface Drupal\Core\Extension core/lib/Drupal/Core/Extension/ConfigImportModuleUninstallValidatorInterface.php Special interface for module uninstall validators for configuration import. 3 1
FieldStorageDefinitionInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php Defines an interface for entity field storage definitions. 3 110
PluginSettingsInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/PluginSettingsInterface.php Interface definition for plugin with settings. 3 1
ConfirmFormInterface interface Drupal\Core\Form core/lib/Drupal/Core/Form/ConfirmFormInterface.php Defines the behavior a confirmation form. 3 2
KeyValueFactoryInterface interface Drupal\Core\KeyValueStore core/lib/Drupal/Core/KeyValueStore/KeyValueFactoryInterface.php Defines the key/value store factory interface. 3 11
PluginWithFormsInterface interface Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/PluginWithFormsInterface.php Provides an interface for plugins which have forms. 3 10
QueueInterface interface Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueInterface.php Interface for a queue. 3 1
OutboundRouteProcessorInterface interface Drupal\Core\RouteProcessor core/lib/Drupal/Core/RouteProcessor/OutboundRouteProcessorInterface.php Defines an interface for classes that process the outbound route. 3 1
RouteMatchInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/RouteMatchInterface.php Provides an interface for classes representing the result of routing. 3 192
RouteProviderInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/RouteProviderInterface.php Defines the route provider interface. 3 21
ComplexDataDefinitionInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/ComplexDataDefinitionInterface.php Interface for complex data definitions. 3 8
TraversableTypedDataInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/TraversableTypedDataInterface.php An interface for typed data objects that can be traversed. 3 3
TypedDataInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/TypedDataInterface.php Interface for typed data objects. 3 21
ResourceIdentifierInterface interface Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/ResourceIdentifierInterface.php An interface for identifying a related resource. 3 2
EntityResolverInterface interface Drupal\serialization\EntityResolver core/modules/serialization/src/EntityResolver/EntityResolverInterface.php 3
CachedDiscoveryInterface interface Drupal\Component\Plugin\Discovery core/lib/Drupal/Component/Plugin/Discovery/CachedDiscoveryInterface.php Interface for discovery components holding a cache of plugin definitions. 3 4
PlaceholderInterface interface Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/PlaceholderInterface.php Interface for a query that accepts placeholders. 3 2
QueryFactoryInterface interface Drupal\Core\Entity\Query core/lib/Drupal/Core/Entity/Query/QueryFactoryInterface.php Defines an interface for QueryFactory classes. 3 5
RenderCallbackInterface interface Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/RenderCallbackInterface.php Indicates all public methods are safe to use in render callbacks. 3 2
MainContentRendererInterface interface Drupal\Core\Render\MainContent core/lib/Drupal/Core/Render/MainContent/MainContentRendererInterface.php The interface for "main content" ( 3 2
PlaceholderStrategyInterface interface Drupal\Core\Render\Placeholder core/lib/Drupal/Core/Render/Placeholder/PlaceholderStrategyInterface.php Provides an interface for defining a placeholder strategy service. 3 2
TranslatorInterface interface Drupal\Core\StringTranslation\Translator core/lib/Drupal/Core/StringTranslation/Translator/TranslatorInterface.php Interface for objects capable of string translation. 3 3
DateSqlInterface interface Drupal\views\Plugin\views\query core/modules/views/src/Plugin/views/query/DateSqlInterface.php Defines an interface for handling date queries with SQL. 3 1
FilterOperatorsInterface interface Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/FilterOperatorsInterface.php Provides an interface for all views filters that implement operators. 3
GeneratedLink class Drupal\Core core/lib/Drupal/Core/GeneratedLink.php Used to return generated links, along with associated cacheability metadata. 2 4
ConfigEntityMapper class Drupal\config_translation core/modules/config_translation/src/ConfigEntityMapper.php Configuration mapper for configuration entities. 2 2
ConfigNamesMapper class Drupal\config_translation core/modules/config_translation/src/ConfigNamesMapper.php Configuration mapper base implementation. 2 1
StringBase abstract class Drupal\locale core/modules/locale/src/StringBase.php Defines the locale string base class. 2

Pages

Other projects