You are here

Classes, traits, and interfaces in Drupal 9

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

Namesort descending Type Namespace Location Description Direct uses Use statements Strings
UnitTestCaseTest class Drupal\Tests core/tests/Drupal/Tests/UnitTestCaseTest.php Tests for the UnitTestCase class.
UnitTestSuite class Drupal\Tests\TestSuites core/tests/TestSuites/UnitTestSuite.php Discovers tests for the unit test suite.
UnknownExtensionException class Drupal\Core\Extension\Exception core/lib/Drupal/Core/Extension/Exception/UnknownExtensionException.php Exception class thrown when a specified extension is not on the filesystem. 12
UnknownExtensionTypeException class Drupal\Core\Extension\Exception core/lib/Drupal/Core/Extension/Exception/UnknownExtensionTypeException.php Exception thrown when a specified extension type is not known.
UnmetDependenciesException class Drupal\Core\Config core/lib/Drupal/Core/Config/UnmetDependenciesException.php An exception thrown if configuration has unmet dependencies. 5
UnprocessableHttpEntityException class Drupal\jsonapi\Exception core/modules/jsonapi/src/Exception/UnprocessableHttpEntityException.php A class to represent a 422 - Unprocessable Entity Exception. 2
UnprocessableHttpEntityExceptionNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/UnprocessableHttpEntityExceptionNormalizer.php Normalizes and UnprocessableHttpEntityException. 2
UnpublishAction class Drupal\Core\Action\Plugin\Action core/lib/Drupal/Core/Action/Plugin/Action/UnpublishAction.php Unpublishes an entity. 1 2
UnpublishByKeywordActionTest class Drupal\Tests\node\Kernel\Action core/modules/node/tests/src/Kernel/Action/UnpublishByKeywordActionTest.php @group node
UnpublishByKeywordComment class Drupal\comment\Plugin\Action core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php Unpublishes a comment containing certain keywords.
UnpublishByKeywordNode class Drupal\node\Plugin\Action core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php Unpublishes a node containing certain keywords.
UnpublishedBlockTest class Drupal\Tests\block_content\Functional core/modules/block_content/tests/src/Functional/UnpublishedBlockTest.php Tests unpublishing of block_content entities.
UnroutedUrlAssembler class Drupal\Core\Utility core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php Provides a way to build external or non Drupal local domain URLs. 2 2
UnroutedUrlAssemblerInterface interface Drupal\Core\Utility core/lib/Drupal/Core/Utility/UnroutedUrlAssemblerInterface.php Provides a way to build external or non Drupal local domain URLs. 1 7
UnroutedUrlAssemblerTest class Drupal\Tests\Core\Utility core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php @coversDefaultClass \Drupal\Core\Utility\UnroutedUrlAssembler @group Utility
UnroutedUrlTest class Drupal\Tests\Core core/tests/Drupal/Tests/Core/UnroutedUrlTest.php @coversDefaultClass \Drupal\Core\Url @group UrlTest
UnsavedPreviewTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php Tests covering Preview of unsaved Views.
UnstickyNode class Drupal\node\Plugin\Action core/modules/node/src/Plugin/Action/UnstickyNode.php Makes a node not sticky.
UnsupportedDataTypeConfigException class Drupal\Core\Config core/lib/Drupal/Core/Config/UnsupportedDataTypeConfigException.php Exception thrown when a config data type is invalid. 2
UnsupportedEntityTypeDefinitionException class Drupal\Core\Entity\Exception core/lib/Drupal/Core/Entity/Exception/UnsupportedEntityTypeDefinitionException.php Defines an exception thrown when an entity type definition is invalid. 3
UntrustedCallbackException class Drupal\Core\Security core/lib/Drupal/Core/Security/UntrustedCallbackException.php Exception thrown if a callback is untrusted. 2
UntrustedObject class Drupal\Tests\Core\Security core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php
UpcastingTest class Drupal\Tests\system\Functional\ParamConverter core/modules/system/tests/src/Functional/ParamConverter/UpcastingTest.php Tests upcasting of url arguments to entities.
Update class Drupal\corefake\Driver\Database\corefakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefakeWithAllCustomClasses/Update.php CorefakeWithAllCustomClasses implementation of \Drupal\Core\Database\Update.
Update class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Update.php General class for an abstracted UPDATE operation. 2 3
Update class Drupal\Core\Database\Driver\pgsql core/lib/Drupal/Core/Database/Driver/pgsql/Update.php PostgreSQL implementation of \Drupal\Core\Database\Query\Update. 1 1
Update class Drupal\driver_test\Driver\Database\DrivertestPgsql core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Update.php PostgreSQL implementation of \Drupal\Core\Database\Query\Update.
UpdateBackend class Drupal\Core\Update core/lib/Drupal/Core/Update/UpdateBackend.php Defines a cache backend for use during Drupal database updates.
UpdateBlockForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/UpdateBlockForm.php Provides a form to update a block. 1
UpdateBuildIdCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/UpdateBuildIdCommand.php AJAX command for updating the value of a hidden form_build_id input element on a form. It requires the form passed in to have keys for both the old build ID in #build_id_old and the new build ID in #build_id. 2
UpdateCacheBackendFactory class Drupal\Core\Update core/lib/Drupal/Core/Update/UpdateCacheBackendFactory.php Cache factory implementation for use during Drupal database updates.
UpdateCacheTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php Tests caches during updates.
UpdateCompilerPass class Drupal\Core\Update core/lib/Drupal/Core/Update/UpdateCompilerPass.php Removes services with unmet dependencies.
UpdateComplexTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/UpdateComplexTest.php Tests the Update query builder, complex queries.
UpdateContribTest class Drupal\Tests\update\Functional core/modules/update/tests/src/Functional/UpdateContribTest.php Tests how the Update Manager module handles contributed modules and themes in a series of functional tests using mock XML data.
UpdateController class Drupal\update\Controller core/modules/update/src/Controller/UpdateController.php Controller routines for update routes.
UpdateDeleteFileIfStaleTest class Drupal\Tests\update\Kernel core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php Tests the update_delete_file_if_stale() function.
UpdateDeprecationTest class Drupal\KernelTests\Core\Extension core/tests/Drupal/KernelTests/Core/Extension/UpdateDeprecationTest.php Tests deprecated update.inc functions.
UpdateDescriptionTest class Drupal\KernelTests\Core\Extension core/tests/Drupal/KernelTests/Core/Extension/UpdateDescriptionTest.php Tests for update descriptions.
UpdateException class Drupal\Core\Utility core/lib/Drupal/Core/Utility/UpdateException.php Exception class used to throw error if a module update fails. 2
UpdateFeedItemTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/UpdateFeedItemTest.php Update feed items from a feed.
UpdateFeedTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/UpdateFeedTest.php Update feed test.
UpdateFetcher class Drupal\update core/modules/update/src/UpdateFetcher.php Fetches project information from remote locations. 2
UpdateFetcherInterface interface Drupal\update core/modules/update/src/UpdateFetcherInterface.php Fetches project information from remote locations. 1 7
UpdateHookRegistry class Drupal\Core\Update core/lib/Drupal/Core/Update/UpdateHookRegistry.php Provides module updates versions handling. 5 2
UpdateHookRegistryFactory class Drupal\Core\Update core/lib/Drupal/Core/Update/UpdateHookRegistryFactory.php Service factory for the versioning update registry. 2
UpdateHookRegistryTest class Drupal\Tests\Core\Update core/tests/Drupal/Tests/Core/Update/UpdateHookRegistryTest.php @coversDefaultClass \Drupal\Core\Update\UpdateHookRegistry @group Update
UpdateKernel class Drupal\Core\Update core/lib/Drupal/Core/Update/UpdateKernel.php Defines a kernel which is used primarily to run the update of Drupal. 3
UpdateLobTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php Tests the Update query builder with LOB fields.
UpdateLocalTasksTest class Drupal\Tests\update\Unit\Menu core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php Tests existence of update local tasks.

Pages

Other projects