Classes, traits, and interfaces - 8.9.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 1511

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
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 one after another with no decorations. 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. 3 6
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
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\driver_test\Driver\Database\DrivertestPgsql core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Delete.php PostgreSQL implementation of \Drupal\Core\Database\Query\Delete.
Delete class Drupal\Core\Database\Driver\sqlite core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php SQLite implementation of \Drupal\Core\Database\Query\Delete.
Delete class Drupal\Core\Database\Driver\mysql core/lib/Drupal/Core/Database/Driver/mysql/Delete.php MySQL implementation of \Drupal\Core\Database\Query\Delete. 1 1
Delete class Drupal\Core\Database\Driver\pgsql core/lib/Drupal/Core/Database/Driver/pgsql/Delete.php PostgreSQL implementation of \Drupal\Core\Database\Query\Delete. 1 1
Delete class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Delete.php General class for an abstracted DELETE operation. 3 4
DeleteAction class Drupal\Core\Action\Plugin\Action core/lib/Drupal/Core/Action/Plugin/Action/DeleteAction.php Redirects to an entity deletion form. 2 2
DeleteActionTest class Drupal\KernelTests\Core\Action core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php @group Action
DeleteComment

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Action\Plugin\Action\DeleteAction instead.

class Drupal\comment\Plugin\Action core/modules/comment/src/Plugin/Action/DeleteComment.php Deletes a comment.
DeleteDefaultLanguageException class Drupal\language\Exception core/modules/language/src/Exception/DeleteDefaultLanguageException.php Exception thrown when deleting the default language. 2
DeletedFieldsRepository class Drupal\Core\Field core/lib/Drupal/Core/Field/DeletedFieldsRepository.php Provides a repository for deleted field and field storage objects. 2
DeletedFieldsRepositoryInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/DeletedFieldsRepositoryInterface.php Provides an interface for a deleted fields repository. 1 2
DeletedWorkspaceConstraint class Drupal\workspaces\Plugin\Validation\Constraint core/modules/workspaces/src/Plugin/Validation/Constraint/DeletedWorkspaceConstraint.php Deleted workspace constraint.
DeletedWorkspaceConstraintValidator class Drupal\workspaces\Plugin\Validation\Constraint core/modules/workspaces/src/Plugin/Validation/Constraint/DeletedWorkspaceConstraintValidator.php Checks if data still exists for a deleted workspace ID.
DeleteFeedItemTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/DeleteFeedItemTest.php Delete feed items from a feed.
DeleteFeedTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/DeleteFeedTest.php Delete feed test.
DeleteForm class Drupal\comment\Form core/modules/comment/src/Form/DeleteForm.php Provides the comment delete confirmation form.
DeleteForm class Drupal\forum\Form core/modules/forum/src/Form/DeleteForm.php Builds the form to delete a forum term. 1
DeleteMultiple class Drupal\node\Form core/modules/node/src/Form/DeleteMultiple.php Provides a node deletion confirmation form. 1
DeleteMultipleForm class Drupal\Core\Entity\Form core/lib/Drupal/Core/Entity/Form/DeleteMultipleForm.php Provides an entities deletion confirmation form. 2 2
DeleteMultipleFormTest class Drupal\FunctionalTests\Entity core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php Tests the delete multiple confirmation form.
DeleteNode

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Action\Plugin\Action\DeleteAction instead.

class Drupal\node\Plugin\Action core/modules/node/src/Plugin/Action/DeleteNode.php Redirects to a node deletion form.
DeleteTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/DeleteTest.php Tests the file delete function.
DeleteTruncateTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php Tests delete and truncate queries.
DemoteNode class Drupal\node\Plugin\Action core/modules/node/src/Plugin/Action/DemoteNode.php Demotes a node.
DemoUmamiProfileTest class Drupal\Tests\demo_umami\Functional core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php Tests demo_umami profile.
DenormalizeTest class Drupal\Tests\hal\Kernel core/modules/hal/tests/src/Kernel/DenormalizeTest.php Tests HAL denormalization edge cases for EntityResource.
DenyAdminRoutes class Drupal\dynamic_page_cache\PageCache\ResponsePolicy core/modules/dynamic_page_cache/src/PageCache/ResponsePolicy/DenyAdminRoutes.php Cache policy for routes with the '_admin_route' option set. 2
DenyNoCacheRoutes class Drupal\Core\PageCache\ResponsePolicy core/lib/Drupal/Core/PageCache/ResponsePolicy/DenyNoCacheRoutes.php Cache policy for routes with the 'no_cache' option set. 2
DenyNodePreview class Drupal\node\PageCache core/modules/node/src/PageCache/DenyNodePreview.php Cache policy for node preview page. 1 2
DenyNodePreviewTest class Drupal\Tests\node\Unit\PageCache core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php @coversDefaultClass \Drupal\node\PageCache\DenyNodePreview @group node
DenyPrivateImageStyleDownload class Drupal\image\PageCache core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php Cache policy for image preview page. 1 2

Other projects


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