Classes, traits, and interfaces - 10.3.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 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
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\Functional core/modules/views/tests/src/Functional/DefaultViewsTest.php Tests the default views provided by views.
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.
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. 1
DefaultWorkspaceHandler class Drupal\workspaces\Entity\Handler core/modules/workspaces/src/Entity/Handler/DefaultWorkspaceHandler.php Common customizations for most entity types. 2 2
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 7
Delete class Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Delete.php CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Delete.
Delete class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/Delete.php SQLite implementation of \Drupal\Core\Database\Query\Delete.
Delete class Drupal\mysql\Driver\Database\mysql core/modules/mysql/src/Driver/Database/mysql/Delete.php MySQL 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. 1 1
DeleteAction class Drupal\Core\Action\Plugin\Action core/lib/Drupal/Core/Action/Plugin/Action/DeleteAction.php Redirects to an entity deletion form.
DeleteActionTest class Drupal\KernelTests\Core\Action core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php @group Action
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.
DeleteForm class Drupal\forum\Form core/modules/forum/src/Form/DeleteForm.php Builds the form to delete a forum term. 1
DeleteForm class Drupal\comment\Form core/modules/comment/src/Form/DeleteForm.php Provides the comment delete confirmation form.
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.
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.
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[[api-linebreak]] @group node
DenyPrivateImageStyleDownload class Drupal\image\PageCache core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php Cache policy for image preview page. 1 2
DenyPrivateImageStyleDownloadTest class Drupal\Tests\image\Unit\PageCache core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php @coversDefaultClass \Drupal\image\PageCache\DenyPrivateImageStyleDownload[[api-linebreak]] @group image
DenyTestAuthRequests class Drupal\rest_test\PageCache\RequestPolicy core/modules/rest/tests/modules/rest_test/src/PageCache/RequestPolicy/DenyTestAuthRequests.php Cache policy for pages requested with REST Test Auth. 2
Dependency class Drupal\Core\Extension core/lib/Drupal/Core/Extension/Dependency.php A value object representing dependency information. 4
DependencyFieldItem class Drupal\Tests\field\Unit core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php A test class.
DependencyHookInvocationTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php Tests the hook invocation for determining update dependencies.
DependencyMissingTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/DependencyMissingTest.php Tests that missing update dependencies are correctly flagged.
DependencyOrderingTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/DependencyOrderingTest.php Tests that update functions are run in the proper order.
DependencySerializationTest class Drupal\Tests\Core\DependencyInjection core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php @coversDefaultClass \Drupal\Core\DependencyInjection\DependencySerializationTrait[[api-linebreak]] @group DependencyInjection
DependencySerializationTestDummy class Drupal\Tests\Core\DependencyInjection core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php Defines a test class which has a single service as dependency.
DependencySerializationTrait trait Drupal\Core\DependencyInjection core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php Provides dependency injection friendly methods for serialization. 52
DependencySerializationTraitPass

in drupal:9.5.0 and is removed from drupal:11.0.0. The _serviceId property is no longer part of the container. Use \Drupal\Core\DrupalKernelInterface::getServiceIdMapping() instead.

class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/DependencySerializationTraitPass.php Sets the _serviceId property on all services.
DependencyTest class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/DependencyTest.php @coversDefaultClass \Drupal\Core\Extension\Dependency[[api-linebreak]] @group Extension
DependencyTest class Drupal\Tests\system\Functional\Module core/modules/system/tests/src/Functional/Module/DependencyTest.php Enable module without dependency enabled.
DependencyTest class Drupal\Tests\forum\Functional\Module core/modules/forum/tests/src/Functional/Module/DependencyTest.php Enable module without dependency enabled.
DependencyTrait trait Drupal\Core\Entity core/lib/Drupal/Core/Entity/DependencyTrait.php Provides a trait for managing an object's dependencies. 6

Other projects


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