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
RequestFormatRouteFilterTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/RequestFormatRouteFilterTest.php @coversDefaultClass \Drupal\Core\Routing\RequestFormatRouteFilter[[api-linebreak]] @group Routing
RequestHandler class Drupal\rest core/modules/rest/src/RequestHandler.php Acts as intermediate request forwarder for resource plugins. 2
RequestHandlerTest class Drupal\Tests\rest\Kernel core/modules/rest/tests/src/Kernel/RequestHandlerTest.php Test REST RequestHandler controller logic.
RequestHelper class Drupal\Core\Routing core/lib/Drupal/Core/Routing/RequestHelper.php Provides some helper methods for dealing with the request. 1
RequestPagerTest class Drupal\KernelTests\Core\Pager core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php @group Pager
RequestPath class Drupal\system\Plugin\Condition core/modules/system/src/Plugin/Condition/RequestPath.php Provides a 'Request Path' condition.
RequestPathTest class Drupal\KernelTests\Core\Plugin\Condition core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php Tests system.module's request path condition.
RequestPolicyInterface interface Drupal\Core\PageCache core/lib/Drupal/Core/PageCache/RequestPolicyInterface.php Defines the interface for request policy implementations. 6 15
RequestSanitizer class Drupal\Core\Security core/lib/Drupal/Core/Security/RequestSanitizer.php Sanitizes user input. 2
RequestSanitizerTest class Drupal\Tests\Core\Security core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php Tests RequestSanitizer class.
RequestStack

in drupal:10.0.0 and is removed from drupal:11.0.0. There is no replacement.

class Drupal\Core\Http core/lib/Drupal/Core/Http/RequestStack.php Forward-compatibility shim for Symfony's RequestStack. 1
RequestStackCacheContextBase abstract class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php Defines a base class for cache contexts depending only on the request stack. 11
RequestStackLegacyTest class Drupal\Tests\Core\Http core/tests/Drupal/Tests/Core/Http/RequestStackLegacyTest.php @coversDefaultClass \Drupal\Core\Http\RequestStack[[api-linebreak]] @group legacy
RequeueException class Drupal\Core\Queue core/lib/Drupal/Core/Queue/RequeueException.php Throw this exception to release the item allowing it to be processed again. 3
RequiredConfigDependenciesConstraint class Drupal\Core\Config\Plugin\Validation\Constraint core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/RequiredConfigDependenciesConstraint.php Checks that config dependencies contain specific types of entities.
RequiredConfigDependenciesConstraintValidator class Drupal\Core\Config\Plugin\Validation\Constraint core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/RequiredConfigDependenciesConstraintValidator.php Validates the RequiredConfigDependencies constraint.
RequiredFieldStorageDefinitionInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/RequiredFieldStorageDefinitionInterface.php Defines an interface for required field storage definitions. 1 1
RequiredModuleUninstallValidator class Drupal\Core\Extension core/lib/Drupal/Core/Extension/RequiredModuleUninstallValidator.php Ensures that required modules cannot be uninstalled. 2
RequiredModuleUninstallValidator class Drupal\Core\ProxyClass\Extension core/lib/Drupal/Core/ProxyClass/Extension/RequiredModuleUninstallValidator.php Provides a proxy class for \Drupal\Core\Extension\RequiredModuleUninstallValidator.
RequiredModuleUninstallValidatorTest class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php @coversDefaultClass \Drupal\Core\Extension\RequiredModuleUninstallValidator[[api-linebreak]] @group Extension
RequiredStateMissingException class Drupal\workflows\Exception core/modules/workflows/src/Exception/RequiredStateMissingException.php Indicates that a workflow does not contain a required state. 2
RequiredStatesTest class Drupal\Tests\workflows\Kernel core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php Tests Workflow type's required states and configuration initialization.
RequiredStateTestType class Drupal\workflow_type_test\Plugin\WorkflowType core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/RequiredStateTestType.php Test workflow type.
RequirementsAwareDestinationInterface interface Drupal\Tests\migrate\Unit core/modules/migrate/tests/src/Unit/MigrationTest.php Defines the RequirementsAwareDestinationInterface.
RequirementsAwareSourceInterface interface Drupal\Tests\migrate\Unit core/modules/migrate/tests/src/Unit/MigrationTest.php Defines the RequirementsAwareSourceInterface.
RequirementsException class Drupal\migrate\Exception core/modules/migrate/src/Exception/RequirementsException.php Defines an exception thrown when a migration does not meet the requirements. 33
RequirementsExceptionTest class Drupal\Tests\migrate\Unit\Exception core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php @coversDefaultClass \Drupal\migrate\Exception\RequirementsException[[api-linebreak]] @group migrate
RequirementsInterface interface Drupal\migrate\Plugin core/modules/migrate/src/Plugin/RequirementsInterface.php An interface to check for a migrate plugin requirements. 5 7
RequirementsPageTrait trait Drupal\Tests core/tests/Drupal/Tests/RequirementsPageTrait.php Provides helper methods for the requirements page. 14
RequirementsTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/RequirementsTest.php Tests the file requirements.
RequirementsTest class Drupal\Tests\mysql\Functional core/modules/mysql/tests/src/Functional/RequirementsTest.php Tests isolation level warning when the config is set in settings.php.
RequirementsTest class Drupal\Tests\system\Kernel\Module core/modules/system/tests/src/Kernel/Module/RequirementsTest.php Covers hook_requirements and hook_requirements_alter. @group Module
RequiresComposerTrait trait Drupal\TestTools\Extension core/tests/Drupal/TestTools/Extension/RequiresComposerTrait.php Ensures Composer executable is available, skips test otherwise. 1
ReservedWordTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php Tests queries that include reserved words.
ResettableStackedRouteMatchInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/ResettableStackedRouteMatchInterface.php Defines an interface for a resettable stack of route matches. 1 4
ResettableStaticTest class Drupal\KernelTests\Core\Bootstrap core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php Tests that drupal_static() and drupal_static_reset() work.
Resize class Drupal\system\Plugin\ImageToolkit\Operation\gd core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Resize.php Defines GD2 resize operation. 1
ResizeImageEffect class Drupal\image\Plugin\ImageEffect core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php Resizes an image resource. 2
ResolvedLibraryDefinitionsFilesMatchTest class Drupal\KernelTests\Core\Asset core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php Tests that the asset files for all core libraries exist.
Resource class Drupal\media\OEmbed core/modules/media/src/OEmbed/Resource.php Value object representing an oEmbed resource. 6
ResourceBase abstract class Drupal\rest\Plugin core/modules/rest/src/Plugin/ResourceBase.php Common base class for resource plugins. 6 6
ResourceController class Drupal\media_test_oembed\Controller core/modules/media/tests/modules/media_test_oembed/src/Controller/ResourceController.php Test controller returning oEmbed resources from Media's test fixtures. 4
ResourceException class Drupal\media\OEmbed core/modules/media/src/OEmbed/ResourceException.php Exception thrown if an oEmbed resource cannot be fetched or parsed. 6
ResourceFetcher class Drupal\media\OEmbed core/modules/media/src/OEmbed/ResourceFetcher.php Fetches and caches oEmbed resources. 2 2
ResourceFetcherInterface interface Drupal\media\OEmbed core/modules/media/src/OEmbed/ResourceFetcherInterface.php Defines an interface for an oEmbed resource fetcher service. 1 6
ResourceFetcherTest class Drupal\Tests\media\Unit core/modules/media/tests/src/Unit/ResourceFetcherTest.php @group media
ResourceFetcherTest class Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/ResourceFetcherTest.php Tests the oEmbed resource fetcher service.
ResourceIdentifier class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/ResourceIdentifier.php Represents a JSON:API resource identifier object. 5
ResourceIdentifierInterface interface Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/ResourceIdentifierInterface.php An interface for identifying a related resource. 3 3
ResourceIdentifierNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/ResourceIdentifierNormalizer.php Normalizes a Relationship according to the JSON:API specification. 1 2

Other projects


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