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
UnitTestCaseTest class Drupal\Tests core/tests/Drupal/Tests/UnitTestCaseTest.php Tests for the UnitTestCase class. 1 1
UnitTestSuite

in drupal:10.3.0 and is removed from drupal:11.0.0. There is no replacement and test discovery will be handled differently in PHPUnit 10.

class Drupal\Tests\TestSuites core/tests/TestSuites/UnitTestSuite.php Discovers tests for the unit test suite.
UnknownCheckpointException final class Drupal\Core\Config\Checkpoint core/lib/Drupal/Core/Config/Checkpoint/UnknownCheckpointException.php Thrown when trying to access a checkpoint that does not exist. 1
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. 19
UnknownExtensionTypeException class Drupal\Core\Extension\Exception core/lib/Drupal/Core/Extension/Exception/UnknownExtensionTypeException.php Exception thrown when a specified extension type is not known. 2
UnknownRecipeException final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/UnknownRecipeException.php Exception thrown when recipe is can not be found. 1
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\Unit\Action core/modules/node/tests/src/Unit/Action/UnpublishByKeywordActionTest.php @group node @group legacy
UnpublishByKeywordActionTest class Drupal\Tests\action\Kernel core/modules/action/tests/src/Kernel/UnpublishByKeywordActionTest.php @group action
UnpublishByKeywordComment class Drupal\action\Plugin\Action core/modules/action/src/Plugin/Action/UnpublishByKeywordComment.php Unpublishes a comment containing certain keywords. 1 1
UnpublishByKeywordComment

in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\action\Plugin\Action\UnpublishByKeywordComment instead.

class Drupal\comment\Plugin\Action core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php Unpublishes a comment containing certain keywords. 1
UnpublishByKeywordCommentTest class Drupal\Tests\action\Kernel core/modules/action/tests/src/Kernel/UnpublishByKeywordCommentTest.php @group action
UnpublishByKeywordCommentTest class Drupal\Tests\comment\Unit\Action core/modules/comment/tests/src/Unit/Action/UnpublishByKeywordCommentTest.php @group comment @group legacy
UnpublishByKeywordNode class Drupal\action\Plugin\Action core/modules/action/src/Plugin/Action/UnpublishByKeywordNode.php Unpublishes a node containing certain keywords. 1 1
UnpublishByKeywordNode

in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\action\Plugin\Action\UnpublishByKeywordNode instead.

class Drupal\node\Plugin\Action core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php Unpublishes a node containing certain keywords. 1
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[[api-linebreak]] @group Utility
UnroutedUrlTest class Drupal\Tests\Core core/tests/Drupal/Tests/Core/UnroutedUrlTest.php @coversDefaultClass \Drupal\Core\Url[[api-linebreak]] @group UrlTest
UnsavedPreviewTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php Tests covering Preview of unsaved Views.
UnserializableRequest class Drupal\Tests\Core\TempStore core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php A class for testing.
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. 4
UntrustedCallbackException class Drupal\Core\Security core/lib/Drupal/Core/Security/UntrustedCallbackException.php Exception thrown if a callback is untrusted. 4
UntrustedObject class Drupal\Tests\Core\Security core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php
UnversionedAssetTest class Drupal\FunctionalTests\Asset core/tests/Drupal/FunctionalTests/Asset/UnversionedAssetTest.php Tests asset aggregation.
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\pgsql\Driver\Database\pgsql core/modules/pgsql/src/Driver/Database/pgsql/Update.php PostgreSQL implementation of \Drupal\Core\Database\Query\Update. 1 1
Update class Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Update.php CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Update.
Update

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/Update.php PostgreSQL implementation of \Drupal\Core\Database\Query\Update. 1
Update class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Update.php General class for an abstracted UPDATE operation. 4 7
Update class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/Update.php SQLite implementation of \Drupal\Core\Database\Query\Update.
Update class Drupal\mysql\Driver\Database\mysql core/modules/mysql/src/Driver/Database/mysql/Update.php MySQL implementation of \Drupal\Core\Database\Query\Update.
Update10101 class Drupal\pgsql core/modules/pgsql/src/Update10101.php An update class for sequence ownership. 2
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 form 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.
UpdateCalculateProjectDataTest class Drupal\Tests\update\Kernel core/modules/update/tests/src/Kernel/UpdateCalculateProjectDataTest.php Test the values set in update_calculate_project_data().
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 handles contributed modules and themes.
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.

Other projects


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