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
Upsert abstract class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Upsert.php General class for an abstracted "Upsert" (UPDATE or INSERT) query operation. 5 7
Upsert class Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Upsert.php CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Upsert.
UpsertTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/UpsertTest.php Tests the Upsert query builder.
Uri class Drupal\Core\TypedData\Plugin\DataType core/lib/Drupal/Core/TypedData/Plugin/DataType/Uri.php The URI data type. 1 1
UriDependentTestImageEffect class Drupal\image_module_test\Plugin\ImageEffect core/modules/image/tests/modules/image_module_test/src/Plugin/ImageEffect/UriDependentTestImageEffect.php Performs an image operation that depends on the URI of the original image.
UriInterface interface Drupal\Core\TypedData\Type core/lib/Drupal/Core/TypedData/Type/UriInterface.php Interface for URIs. 1 3
UriItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php Defines the 'uri' entity field type. 1 3
UriItemTest class Drupal\Tests\Core\Field core/tests/Drupal/Tests/Core/Field/UriItemTest.php Defines a test for the UriItem field-type.
UriItemTest class Drupal\Tests\field\Kernel\Uri core/modules/field/tests/src/Kernel/Uri/UriItemTest.php Tests URI field functionality.
UriLinkFormatter class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/UriLinkFormatter.php Plugin implementation of the 'uri_link' formatter.
UriWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/UriWidget.php Plugin implementation of the 'uri' widget.
Url class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Url.php Provides a form element for input of a URL.
Url class Drupal\Core core/lib/Drupal/Core/Url.php Defines an object that holds information about a URL. 1 732
Url class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/Url.php Field handler to provide simple renderer that turns a URL into a clickable link.
UrlAlias class Drupal\path\Plugin\migrate\source\d6 core/modules/path/src/Plugin/migrate/source/d6/UrlAlias.php Drupal 6 URL aliases source from database.
UrlAlias class Drupal\path\Plugin\migrate\source\d7 core/modules/path/src/Plugin/migrate/source/d7/UrlAlias.php Drupal 7 URL aliases source from database.
UrlAliasBase abstract class Drupal\path\Plugin\migrate\source core/modules/path/src/Plugin/migrate/source/UrlAliasBase.php Base class for the url_alias source plugins. 2 2
UrlAliasTest class Drupal\Tests\path\Kernel\Plugin\migrate\source\d6 core/modules/path/tests/src/Kernel/Plugin/migrate/source/d6/UrlAliasTest.php Tests the d6_url_alias source plugin.
UrlAliasTest class Drupal\Tests\path\Kernel\Plugin\migrate\source\d7 core/modules/path/tests/src/Kernel/Plugin/migrate/source/d7/UrlAliasTest.php Tests the d7_url_alias source plugin.
UrlAlterFunctionalTest class Drupal\Tests\path_alias\Functional core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php Tests altering the inbound path and the outbound path.
UrlAlterFunctionalTest class Drupal\Tests\forum\Functional core/modules/forum/tests/src/Functional/UrlAlterFunctionalTest.php Tests altering the inbound path and the outbound path.
UrlAlterTest class Drupal\KernelTests\Core\Path core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php Tests the capability to alter URLs.
UrlBubbleableMetadataBubblingTest class Drupal\Tests\system\Functional\Render core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php Tests that URL bubbleable metadata is correctly bubbled.
UrlCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/UrlCacheContext.php Defines the UrlCacheContext service, for "per page" caching. 2
UrlConversionTest class Drupal\Tests\Core\Database core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php Tests for database URL to/from database connection array conversions.
UrlEncode class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/UrlEncode.php URL-encodes the input value. 1
UrlEncodeTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\UrlEncode[[api-linebreak]] @group file
UrlGenerator class Drupal\Core\Routing core/lib/Drupal/Core/Routing/UrlGenerator.php Generates URLs from route names and parameters. 1 4 2
UrlGeneratorInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php Defines an interface for generating a URL from a route or system path. 3 17
UrlGeneratorTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php Confirm that the UrlGenerator is functioning properly. 1 1
UrlHelper class Drupal\Component\Utility core/lib/Drupal/Component/Utility/UrlHelper.php Helper class URL based methods. 80
UrlHelperTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php @group Utility
UrlIntegrationTest class Drupal\KernelTests\Core\Routing core/tests/Drupal/KernelTests/Core/Routing/UrlIntegrationTest.php Tests the URL object integration into the access system.
UrlMatcher class Drupal\Core\Routing core/lib/Drupal/Core/Routing/UrlMatcher.php Drupal-specific URL Matcher; handles the Drupal "system path" mapping. 1
UrlPlainFormatter class Drupal\file\Plugin\Field\FieldFormatter core/modules/file/src/Plugin/Field/FieldFormatter/UrlPlainFormatter.php Plugin implementation of the 'file_url_plain' formatter.
UrlResolver class Drupal\media\OEmbed core/modules/media/src/OEmbed/UrlResolver.php Converts oEmbed media URLs into endpoint-specific resource URLs. 1 1 2
UrlResolver class Drupal\media_test_oembed core/modules/media/tests/modules/media_test_oembed/src/UrlResolver.php Overrides the oEmbed URL resolver service for testing purposes. 1
UrlResolverInterface interface Drupal\media\OEmbed core/modules/media/src/OEmbed/UrlResolverInterface.php Defines the interface for the oEmbed URL resolver service. 1 7
UrlResolverTest class Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/UrlResolverTest.php Tests the oEmbed URL resolver service.
UrlTest class Drupal\Tests\Core core/tests/Drupal/Tests/Core/UrlTest.php @coversDefaultClass \Drupal\Core\Url[[api-linebreak]] @group UrlTest
UrlTest class Drupal\Tests\system\Kernel\Common core/modules/system/tests/src/Kernel/Common/UrlTest.php Tests the Url object.
UrlTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/UrlTest.php Tests the form API URL element.
UrlTest class Drupal\Tests\system\Functional\Common core/modules/system/tests/src/Functional/Common/UrlTest.php Confirm that the link generator works correctly.
UrlTestEntity class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php 1
UrlTransformRelativeTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/UrlTransformRelativeTest.php Tests URL transform to relative.
UsageTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/UsageTest.php Tests file usage functions.
UseCacheBackendTrait trait Drupal\Core\Cache core/lib/Drupal/Core/Cache/UseCacheBackendTrait.php Provides methods to use a cache backend while respecting a 'use caches' flag. 4
Used final class Drupal\Tests\Component\Annotation\Doctrine\Fixtures\Attribute core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/Attribute/Used.php #[ExampleAttribute]
UsedAs final class Drupal\Tests\Component\Annotation\Doctrine\Fixtures\Attribute core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/Attribute/UsedAs.php #[ClassAttribute]
UsedAsQualified final class Drupal\Tests\Component\Annotation\Doctrine\Fixtures\Attribute core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/Attribute/UsedAsQualified.php #[ClassAttributes\ExampleAttribute]

Other projects


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