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
LazyRouteCollectionTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php @coversDefaultClass \Drupal\Core\Routing\LazyRouteCollection[[api-linebreak]]
LazyRouteProviderInstallTest class Drupal\FunctionalTests\Routing core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php @group routing
LeaveProfileNode class Drupal\sdc_other_node_visitor\Twig\Profiler core/modules/system/tests/modules/sdc_other_node_visitor/src/Twig/Profiler/LeaveProfileNode.php Represents a profile leave node. 1
LegacyAssetTest class Drupal\KernelTests\Core\Asset core/tests/Drupal/KernelTests/Core/Asset/LegacyAssetTest.php Tests deprecated asset functions.
LegacyBootstrapTest class Drupal\KernelTests\Core\Bootstrap core/tests/Drupal/KernelTests/Core/Bootstrap/LegacyBootstrapTest.php Tests legacy bootstrap functions.
LegacyCommonTest class Drupal\KernelTests\Core\Common core/tests/Drupal/KernelTests/Core/Common/LegacyCommonTest.php Tests deprecated legacy functions in common.inc.
LegacyExtensionTest class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/LegacyExtensionTest.php @coversDefaultClass \Drupal\Core\Extension\Extension[[api-linebreak]] @group Extension @group legacy
LegacyFileModuleTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/LegacyFileModuleTest.php Tests file module deprecations.
LegacyFileSystemTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/LegacyFileSystemTest.php Tests the legacy file system functions.
LegacyFileThemeTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/LegacyFileThemeTest.php Tests legacy deprecated functions in file.module.
LegacyFileUploadHandlerTest class Drupal\Tests\file\Kernel\Upload core/modules/file/tests/src/Kernel/Upload/LegacyFileUploadHandlerTest.php Provides tests for legacy file upload handler code.
LegacyHook class Drupal\Core\Hook\Attribute core/lib/Drupal/Core/Hook/Attribute/LegacyHook.php This class will not have an effect until Drupal 11.1.0.
LegacyMatcherDumperTest class Drupal\KernelTests\Core\Routing core/tests/Drupal/KernelTests/Core/Routing/LegacyMatcherDumperTest.php Tests deprecations in MatcherDumper.
LegacyPasswordHashingTest class Drupal\Tests\phpass\Unit core/modules/phpass/tests/src/Unit/LegacyPasswordHashingTest.php Unit tests for password hashing API.
LegacySettingsRewriteTest class Drupal\KernelTests\Core\Site core/tests/Drupal/KernelTests/Core/Site/LegacySettingsRewriteTest.php Tests the drupal_rewrite_settings() function.
LegacyStateTest class Drupal\KernelTests\Core\State core/tests/Drupal/KernelTests/Core/State/LegacyStateTest.php Tests the legacy state deprecations.
LegacyUserTest class Drupal\Tests\user\Kernel core/modules/user/tests/src/Kernel/LegacyUserTest.php Tests deprecated user module functions.
LegacyValidateTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/LegacyValidateTest.php Tests the file_validate() function.
LegacyValidatorTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/LegacyValidatorTest.php Tests the functions used to validate uploaded files.
LengthConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/LengthConstraint.php Length constraint.
LibrariesBCLayerTest final class Drupal\Tests\sdc\Functional core/modules/sdc/tests/src/Functional/LibrariesBCLayerTest.php Tests the correct rendering of components.
LibrariesDirectoryFileFinder class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibrariesDirectoryFileFinder.php Finds files that are located in the supported 'libraries' directories. 2 2
LibrariesDirectoryFileFinderTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php @coversDefaultClass \Drupal\Core\Asset\LibrariesDirectoryFileFinder[[api-linebreak]] @group Asset
LibraryDefinitionMissingLicenseException class Drupal\Core\Asset\Exception core/lib/Drupal/Core/Asset/Exception/LibraryDefinitionMissingLicenseException.php Defines a custom exception if a library has a remote but no license. 2
LibraryDependencyResolver class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDependencyResolver.php Resolves the dependencies of asset (CSS/JavaScript) libraries. 1 2
LibraryDependencyResolverInterface interface Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDependencyResolverInterface.php Resolves the dependencies of asset (CSS/JavaScript) libraries. 1 2
LibraryDependencyResolverTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php @coversDefaultClass \Drupal\Core\Asset\LibraryDependencyResolver[[api-linebreak]] @group Asset
LibraryDiscovery class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDiscovery.php Discovers available asset libraries in Drupal. 1 2
LibraryDiscoveryCollector class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php A CacheCollector implementation for building library extension info. 1 2
LibraryDiscoveryCollectorTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php @coversDefaultClass \Drupal\Core\Asset\LibraryDiscoveryCollector[[api-linebreak]] @group Asset
LibraryDiscoveryIntegrationTest class Drupal\KernelTests\Core\Asset core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php Tests the library discovery and library discovery parser.
LibraryDiscoveryInterface interface Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDiscoveryInterface.php Discovers information for asset (CSS/JavaScript) libraries. 1
LibraryDiscoveryParser class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php Parses library files to get extension data. 1 1 2
LibraryDiscoveryParserTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php @coversDefaultClass \Drupal\Core\Asset\LibraryDiscoveryParser[[api-linebreak]] @group Asset
LibraryDiscoveryTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php @coversDefaultClass \Drupal\Core\Asset\LibraryDiscovery[[api-linebreak]] @group Asset
LinearHistory final class Drupal\Core\Config\Checkpoint core/lib/Drupal/Core/Config/Checkpoint/LinearHistory.php A chronological list of Checkpoint objects. 2 2
LinearHistoryTest class Drupal\Tests\Core\Config\Checkpoint core/tests/Drupal/Tests/Core/Config/Checkpoint/LinearHistoryTest.php @coversDefaultClass \Drupal\Core\Config\Checkpoint\LinearHistory[[api-linebreak]] @group Config
Link class Drupal\Core core/lib/Drupal/Core/Link.php Defines an object that holds information about a link. 98
Link class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Link.php Provides a link render element. 2 3
Link final class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/Link.php Represents an RFC8288 based link. 7
LinkAccessConstraint class Drupal\link\Plugin\Validation\Constraint core/modules/link/src/Plugin/Validation/Constraint/LinkAccessConstraint.php Defines an access validation constraint for links. 1
LinkAccessConstraintValidator class Drupal\link\Plugin\Validation\Constraint core/modules/link/src/Plugin/Validation/Constraint/LinkAccessConstraintValidator.php Validates the LinkAccess constraint. 1
LinkAccessConstraintValidatorTest class Drupal\Tests\link\Unit\Plugin\Validation\Constraint core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php Tests the LinkAccessConstraintValidator validator.
LinkApprove class Drupal\comment\Plugin\views\field core/modules/comment/src/Plugin/views/field/LinkApprove.php Provides a comment approve link. 1
LinkApproveTest class Drupal\Tests\comment\Unit\Plugin\views\field core/modules/comment/tests/src/Unit/Plugin/views/field/LinkApproveTest.php @coversDefaultClass \Drupal\comment\Plugin\views\field\LinkApprove[[api-linebreak]] @group comment
LinkBase abstract class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/LinkBase.php Field handler to present a link to an entity. 5 5
LinkBaseTest class Drupal\Tests\views\Unit\Plugin\views\field core/modules/views/tests/src/Unit/Plugin/views/field/LinkBaseTest.php @coversDefaultClass \Drupal\views\Plugin\views\field\EntityLink[[api-linebreak]] @group Views
LinkCollection final class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/LinkCollection.php Contains a set of JSON:API Link objects. 9
LinkCollectionNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/LinkCollectionNormalizer.php Normalizes a LinkCollection object. 1 2
LinkCollectionNormalizerTest class Drupal\Tests\jsonapi\Kernel\Normalizer core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php @coversDefaultClass \Drupal\jsonapi\Normalizer\LinkCollectionNormalizer[[api-linebreak]] @group jsonapi

Other projects


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