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 statementssort ascending Strings
PluginID class Drupal\Component\Plugin\Attribute core/lib/Drupal/Component/Plugin/Attribute/PluginID.php 6 9
MigrateLookupInterface interface Drupal\migrate core/modules/migrate/src/MigrateLookupInterface.php Provides an interface for the migration lookup service. 1 9
PluginFormFactoryInterface interface Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/PluginFormFactoryInterface.php Provides an interface for retrieving form objects for plugins. 1 9
AttachmentsInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/AttachmentsInterface.php Defines an interface for responses that can expose #attached metadata. 4 9
EnhancerInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/EnhancerInterface.php A route enhance service to determine route enhance rules. 8 9
PrimitiveInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/PrimitiveInterface.php Interface for primitive data. 8 9
CKEditor5PluginConfigurableInterface interface Drupal\ckeditor5\Plugin core/modules/ckeditor5/src/Plugin/CKEditor5PluginConfigurableInterface.php Defines an interface for configurable CKEditor 5 plugins. 10 9
WorkspaceDynamicSafeFormInterface interface Drupal\Core\Form core/lib/Drupal/Core/Form/WorkspaceDynamicSafeFormInterface.php Defines an interface for forms that can be workspace-safe. 8 9
ContextAwarePluginTrait trait Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php Provides a trait to add context-aware functionality to plugins. 9
StubTestTrait trait Drupal\migrate_drupal\Tests core/modules/migrate_drupal/src/Tests/StubTestTrait.php Provides common functionality for testing stubbing. 9
PhpUnitWarnings trait Drupal\Tests\Traits core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php Converts deprecation warnings added by PHPUnit to silenced deprecations. 9
ScaffoldOptions class Drupal\Composer\Plugin\Scaffold composer/Plugin/Scaffold/ScaffoldOptions.php Per-project options from the 'extras' section of the composer.json file. 8
State class Drupal\workflows core/modules/workflows/src/State.php A value object representing a workflow state. 8
PluginManagerBase abstract class Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/PluginManagerBase.php Base class for plugin managers. 5 8
Environment class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Environment.php Provides PHP environment helper methods. 8
Variable class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Variable.php Provides helpers for dealing with variables. 8
ReplaceCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/ReplaceCommand.php AJAX command for calling the jQuery replace() method. 8
ImmutableConfig class Drupal\Core\Config core/lib/Drupal/Core/Config/ImmutableConfig.php Defines the immutable configuration object. 8
IntegrityConstraintViolationException class Drupal\Core\Database core/lib/Drupal/Core/Database/IntegrityConstraintViolationException.php Exception thrown if a query would violate an integrity constraint. 8
FieldException class Drupal\Core\Field core/lib/Drupal/Core/Field/FieldException.php Base class for all exceptions thrown by the Entity Field API functions. 1 8
FieldItemBase abstract class Drupal\Core\Field core/lib/Drupal/Core/Field/FieldItemBase.php An entity field item. 6 8
DefaultLazyPluginCollection class Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php Provides a default plugin collection for a plugin type. 6 8
PrivateTempStoreFactory class Drupal\Core\TempStore core/lib/Drupal/Core/TempStore/PrivateTempStoreFactory.php Creates a PrivateTempStore object for a given collection. 8 2
SectionStorageDefinition class Drupal\layout_builder\SectionStorage core/modules/layout_builder/src/SectionStorage/SectionStorageDefinition.php Provides section storage type plugin definition. 8
Shortcut class Drupal\shortcut\Entity core/modules/shortcut/src/Entity/Shortcut.php Defines the shortcut entity class. 8
PluginDefinition class Drupal\Component\Plugin\Definition core/lib/Drupal/Component/Plugin/Definition/PluginDefinition.php 8 8
AnnotatedClassDiscovery class Drupal\Core\Plugin\Discovery core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php Defines a discovery mechanism to find annotated plugins in PSR-4 namespaces. 1 8
ContentTranslationUITestBase abstract class Drupal\Tests\content_translation\Functional core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php Tests the Content Translation UI. 9 8
DriverSpecificDatabaseTestBase abstract class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/DriverSpecificDatabaseTestBase.php Base class for driver specific database tests. 10 8
EntityContentBase class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php Provides destination class for all content entities lacking a specific class. 5 8
MigrateProcessTestCase abstract class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/MigrateProcessTestCase.php 27 8
Connection class Drupal\mysql\Driver\Database\mysql core/modules/mysql/src/Driver/Database/mysql/Connection.php MySQL implementation of \Drupal\Core\Database\Connection. 4 8
Connection class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/Connection.php SQLite implementation of \Drupal\Core\Database\Connection. 2 8
CachePluginBase abstract class Drupal\views\Plugin\views\cache core/modules/views/src/Plugin/views/cache/CachePluginBase.php The base plugin to handle caching. 8
FieldableEntity abstract class Drupal\migrate_drupal\Plugin\migrate\source\d7 core/modules/migrate_drupal/src/Plugin/migrate/source/d7/FieldableEntity.php Base class for D7 source plugins which need to collect field values. 8 8
ViewsSort class Drupal\views\Attribute core/modules/views/src/Attribute/ViewsSort.php 8
BlockContentInterface interface Drupal\block_content core/modules/block_content/src/BlockContentInterface.php Provides an interface defining a content block entity. 1 8
ConfigMapperManagerInterface interface Drupal\config_translation core/modules/config_translation/src/ConfigMapperManagerInterface.php Provides a common interface for config mapper managers. 8
MediaTypeInterface interface Drupal\media core/modules/media/src/MediaTypeInterface.php Provides an interface defining a media type entity. 1 8
FieldDiscoveryInterface interface Drupal\migrate_drupal core/modules/migrate_drupal/src/FieldDiscoveryInterface.php Provides field discovery for Drupal 6 & 7 migrations. 1 8
NodeTypeInterface interface Drupal\node core/modules/node/src/NodeTypeInterface.php Provides an interface defining a node type entity. 1 8
WorkspaceInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspaceInterface.php Defines an interface for the workspace entity type. 1 8
WorkspaceManagerInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspaceManagerInterface.php Provides an interface for managing Workspaces. 8
BlockManagerInterface interface Drupal\Core\Block core/lib/Drupal/Core/Block/BlockManagerInterface.php Provides an interface for the discovery and instantiation of block plugins. 1 8
ConfigFactoryOverrideInterface interface Drupal\Core\Config core/lib/Drupal/Core/Config/ConfigFactoryOverrideInterface.php Defines the interface for a configuration factory override object. 8 8
LayoutPluginManagerInterface interface Drupal\Core\Layout core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php Provides the interface for a plugin manager of layouts. 1 8
MenuLinkManagerInterface interface Drupal\Core\Menu core/lib/Drupal/Core/Menu/MenuLinkManagerInterface.php Defines an interface for managing menu links and storing their definitions. 1 8
RedirectDestinationInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php Provides an interface for redirect destinations. 1 8
ThemeNegotiatorInterface interface Drupal\Core\Theme core/lib/Drupal/Core/Theme/ThemeNegotiatorInterface.php Defines an interface for classes which determine the active theme. 10 8
ComplexDataDefinitionInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/ComplexDataDefinitionInterface.php Interface for complex data definitions. 3 8

Pages

Other projects