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
Delete class Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/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\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. 2 2
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
DeleteAuthorizeSettingsUpdateTest class Drupal\Tests\system\Functional\Update core/modules/system/tests/src/Functional/Update/DeleteAuthorizeSettingsUpdateTest.php Tests the upgrade path for removal the system.authorize configuration.
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.
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
DenyPrivateImageStyleDownloadTest class Drupal\Tests\image\Unit\PageCache core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php @coversDefaultClass \Drupal\image\PageCache\DenyPrivateImageStyleDownload @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. 2
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 @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. 51
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 @group Extension
DependencyTest class Drupal\Tests\system\Functional\Module core/modules/system/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
DependentAccessInterface interface Drupal\block_content\Access core/modules/block_content/src/Access/DependentAccessInterface.php Interface for AccessibleInterface objects that have an access dependency. 1 1
DependentAccessTest class Drupal\Tests\block_content\Unit\Access core/modules/block_content/tests/src/Unit/Access/DependentAccessTest.php @coversDefaultClass \Drupal\block_content\Access\RefinableDependentAccessTrait
DependentPluginDefinitionInterface interface Drupal\Core\Plugin\Definition core/lib/Drupal/Core/Plugin/Definition/DependentPluginDefinitionInterface.php Provides an interface for a plugin definition that has dependencies. 1 3
DependentPluginDefinitionTrait trait Drupal\Core\Plugin\Definition core/lib/Drupal/Core/Plugin/Definition/DependentPluginDefinitionTrait.php Provides a trait for a plugin definition that has dependencies. 1
DependentPluginInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/DependentPluginInterface.php Provides an interface for a plugin that has dependencies. 24 28
DependentWithRemovalPluginInterface interface Drupal\views\Plugin core/modules/views/src/Plugin/DependentWithRemovalPluginInterface.php Provides an interface for a plugin that has dependencies that can be removed. 2 3
DeprecatedArray class Drupal\Component\Utility core/lib/Drupal/Component/Utility/DeprecatedArray.php An array that triggers a deprecation warning when accessed.

Other projects


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