Classes, traits, and interfaces - 9.5.x - drupal

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

File

core/core.api.php, line 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
DefaultHtmlRouteProviderTest class Drupal\Tests\Core\Entity\Routing core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php @coversDefaultClass \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider @group Entity
DefaultLangcode class Drupal\language\Plugin\migrate\destination core/modules/language/src/Plugin/migrate/destination/DefaultLangcode.php Provides a destination plugin for the default langcode config.
DefaultLanguageItem class Drupal\language core/modules/language/src/DefaultLanguageItem.php Alternative plugin implementation of the 'language' field type.
DefaultLanguageRenderer class Drupal\views\Entity\Render core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php Renders entities in their default language.
DefaultLazyPluginCollection class Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php Provides a default plugin collection for a plugin type. 6 9
DefaultLazyPluginCollectionTest class Drupal\Tests\Core\Plugin core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php @coversDefaultClass \Drupal\Core\Plugin\DefaultLazyPluginCollection @group Plugin
DefaultMenuLinkTreeManipulators class Drupal\Core\Menu core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php Provides a couple of menu link tree manipulators. 1 2
DefaultMenuLinkTreeManipulatorsTest class Drupal\Tests\Core\Menu core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php Tests the default menu link tree manipulators.
DefaultMetatagsTest class Drupal\Tests\system\Functional\Page core/modules/system/tests/src/Functional/Page/DefaultMetatagsTest.php Tests default HTML metatags on a page.
DefaultMobileMetaTagsTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php Confirm that the default mobile meta tags appear as expected.
DefaultModerationStateTest class Drupal\Tests\content_moderation\Functional core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php Tests setting a custom default moderation state.
DefaultNegotiator class Drupal\Core\Theme core/lib/Drupal/Core/Theme/DefaultNegotiator.php Determines the default theme of the site. 2
DefaultParser class Drupal\aggregator\Plugin\aggregator\parser core/modules/aggregator/src/Plugin/aggregator/parser/DefaultParser.php Defines a default parser implementation. 1 1
DefaultPasswordGenerator class Drupal\Core\Password core/lib/Drupal/Core/Password/DefaultPasswordGenerator.php Provides a default password generator. 1 2
DefaultPasswordGeneratorTest class Drupal\Tests\Core\Password core/tests/Drupal/Tests/Core/Password/DefaultPasswordGeneratorTest.php Unit tests for password generator.
DefaultPluginManager class Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/DefaultPluginManager.php Base class for plugin managers. 50 50
DefaultPluginManagerTest class Drupal\Tests\Core\Plugin core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php Tests the DefaultPluginManager.
DefaultProcessor class Drupal\aggregator\Plugin\aggregator\processor core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php Defines a default processor implementation.
DefaultRequestPolicy class Drupal\Core\PageCache core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php The default page cache request policy. 2
DefaultRequestPolicy class Drupal\dynamic_page_cache\PageCache\RequestPolicy core/modules/dynamic_page_cache/src/PageCache/RequestPolicy/DefaultRequestPolicy.php The default Dynamic Page Cache request policy. 2
DefaultRevisionStateTest class Drupal\Tests\content_moderation\Kernel core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php Tests the correct default revision is set.
DefaultSelection class Drupal\Core\Entity\Plugin\EntityReferenceSelection core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php Default plugin implementation of the Entity Reference Selection plugin. 9 8
DefaultSelectionDeriver class Drupal\Core\Entity\Plugin\Derivative core/lib/Drupal/Core/Entity/Plugin/Derivative/DefaultSelectionDeriver.php Provides derivative plugins for the DefaultSelection plugin.
DefaultsEntityForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/DefaultsEntityForm.php Provides a form containing the Layout Builder UI for defaults. 1
DefaultSingleLazyPluginCollection class Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php Provides a default plugin collection for a plugin type. 3 7
DefaultSingleLazyPluginCollectionTest class Drupal\Tests\Core\Plugin core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php @coversDefaultClass \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection @group Plugin
DefaultsSectionStorage class Drupal\layout_builder\Plugin\SectionStorage core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php Defines the 'defaults' section storage type. 2
DefaultsSectionStorageInterface interface Drupal\layout_builder core/modules/layout_builder/src/DefaultsSectionStorageInterface.php Defines an interface for an object that stores layout sections for defaults. 1 5
DefaultsSectionStorageTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php @coversDefaultClass \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage
DefaultsSectionStorageTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php @coversDefaultClass \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage
DefaultsTestPluginManager class Drupal\plugin_test\Plugin core/modules/system/tests/modules/plugin_test/src/Plugin/DefaultsTestPluginManager.php Defines a plugin manager used by Plugin API unit tests. 1
DefaultStyle class Drupal\views\Plugin\views\style core/modules/views/src/Plugin/views/style/DefaultStyle.php Unformatted style plugin to render rows. 1
DefaultSummary class Drupal\views\Plugin\views\style core/modules/views/src/Plugin/views/style/DefaultSummary.php The default style plugin for summaries. 1 1
DefaultTableMapping class Drupal\Core\Entity\Sql core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php Defines a default table mapping class. 2 5
DefaultTableMappingIntegrationTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php Tests the default table mapping class for content entities stored in SQL.
DefaultTableMappingTest class Drupal\Tests\Core\Entity\Sql core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php @coversDefaultClass \Drupal\Core\Entity\Sql\DefaultTableMapping @group Entity
DefaultValue class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/DefaultValue.php Returns a given default value if the input is empty. 1
DefaultValueTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/DefaultValueTest.php Tests the default_value process plugin.
DefaultViewRecentCommentsTest class Drupal\Tests\comment\Functional\Views core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php Tests results for the Recent Comments view shipped with the module.
DefaultViewsTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php Tests enabling, disabling, and reverting default views via the listing page.
DefaultViewsTest class Drupal\Tests\views\Functional core/modules/views/tests/src/Functional/DefaultViewsTest.php Tests the default views provided by views.
DefaultWizardDeriver class Drupal\views\Plugin\Derivative core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php A derivative class which provides automatic wizards for all base tables.
DefinedTestAccessCheck class Drupal\router_test\Access core/modules/system/tests/modules/router_test_directory/src/Access/DefinedTestAccessCheck.php Defines an access checker similar to DefaultAccessCheck. 1
DelayableQueueInterface interface Drupal\Core\Queue core/lib/Drupal/Core/Queue/DelayableQueueInterface.php Delayable queue interface. 1 1
DelayedRequeueException class Drupal\Core\Queue core/lib/Drupal/Core/Queue/DelayedRequeueException.php Throw this exception to leave an item in the queue until its lock expires. 5
Delete

in drupal:9.4.0 and is removed from drupal:11.0.0. The PostgreSQL database driver has been moved to the pgsql module.

class Drupal\Core\Database\Driver\pgsql core/lib/Drupal/Core/Database/Driver/pgsql/Delete.php PostgreSQL implementation of \Drupal\Core\Database\Query\Delete. 1
Delete class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Delete.php General class for an abstracted DELETE operation. 4 5
Delete class Drupal\corefake\Driver\Database\corefakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefakeWithAllCustomClasses/Delete.php CorefakeWithAllCustomClasses implementation of \Drupal\Core\Database\Delete.
Delete class Drupal\driver_test\Driver\Database\DrivertestMysql core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Delete.php MySQL test implementation of \Drupal\Core\Database\Query\Delete.
Delete class Drupal\pgsql\Driver\Database\pgsql core/modules/pgsql/src/Driver/Database/pgsql/Delete.php PostgreSQL implementation of \Drupal\Core\Database\Query\Delete. 2 2

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.