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
UniqueLabelInListConstraintValidator class Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/UniqueLabelInListConstraintValidator.php Uniquely labeled list item constraint validator.
UniquePathAliasConstraint class Drupal\Core\Path\Plugin\Validation\Constraint core/lib/Drupal/Core/Path/Plugin/Validation/Constraint/UniquePathAliasConstraint.php Validation constraint for unique path alias values.
UniquePathAliasConstraintValidator class Drupal\Core\Path\Plugin\Validation\Constraint core/lib/Drupal/Core/Path/Plugin/Validation/Constraint/UniquePathAliasConstraintValidator.php Constraint validator for a unique path alias.
UnitTestCase abstract class Drupal\Tests core/tests/Drupal/Tests/UnitTestCase.php Provides a base class and helpers for Drupal unit tests. 617 612
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. 13
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[[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. 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\pgsql\Driver\Database\pgsql core/modules/pgsql/src/Driver/Database/pgsql/Update.php PostgreSQL implementation of \Drupal\Core\Database\Query\Update. 2 2
Update class Drupal\driver_test\Driver\Database\DrivertestMysql core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Update.php MySQL test implementation of \Drupal\Core\Database\Query\Update.
Update class Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Update.php MySQL test implementation of \Drupal\Core\Database\Query\Update.
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.
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. 2 2
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 5
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.
UpdateAddViewUpdateNotificationsPermissionTest class Drupal\Tests\update\Functional\Update core/modules/update/tests/src/Functional/Update/UpdateAddViewUpdateNotificationsPermissionTest.php Tests update_post_update_add_view_update_notifications_permission().
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.
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.
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.

Other projects


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