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
RenderElement abstract class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/RenderElement.php Provides a base class for render element plugins. 29 14
RenderElement class Drupal\Core\Render\Annotation core/lib/Drupal/Core/Render/Annotation/RenderElement.php Defines a render element plugin annotation object. 1
RenderElementHelper class Drupal\inline_form_errors core/modules/inline_form_errors/src/RenderElementHelper.php Provides functionality to process render elements. 1
RenderElementTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php @coversDefaultClass \Drupal\Core\Render\Element\RenderElement[[api-linebreak]] @group Render
RenderElementTypesTest class Drupal\KernelTests\Core\Render\Element core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php Tests the rendered markup of core render element types.
Renderer class Drupal\Core\Render core/lib/Drupal/Core/Render/Renderer.php Turns a render array into an HTML string. 2 2
RendererBase abstract class Drupal\views\Entity\Render core/modules/views/src/Entity/Render/RendererBase.php Defines a base class for entity renderers. 2
RendererBubblingTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererCallbackTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererDebugTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererDebugTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/RendererInterface.php Defines an interface for turning a render array into a string. 1 73
RendererPlaceholdersTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @covers \Drupal\Core\Render\RenderCache[[api-linebreak]] @covers \Drupal\Core\Render\PlaceholderingRenderCache[[api-linebreak]] @group Render
RendererRecursionTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererTest.php @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @group Render
RendererTestBase abstract class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererTestBase.php Base class for the actual unit tests testing \Drupal\Core\Render\Renderer. 8 1
RenderEvents final class Drupal\Core\Render core/lib/Drupal/Core/Render/RenderEvents.php Defines events for the render system. 3
RenderPlaceholderMessageTestController class Drupal\render_placeholder_message_test core/modules/system/tests/modules/render_placeholder_message_test/src/RenderPlaceholderMessageTestController.php
RenderTest class Drupal\KernelTests\Core\Render core/tests/Drupal/KernelTests/Core/Render/RenderTest.php Performs functional tests on \Drupal::service('renderer')->render().
RenderWebTest class Drupal\Tests\system\Functional\Common core/modules/system/tests/src/Functional/Common/RenderWebTest.php Performs integration tests on \Drupal::service('renderer')->render().
ReorderDisplays class Drupal\views_ui\Form\Ajax core/modules/views_ui/src/Form/Ajax/ReorderDisplays.php Displays the display reorder form.
ReplaceCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/ReplaceCommand.php AJAX command for calling the jQuery replace() method. 11
ReplaceOp class Drupal\Composer\Plugin\Scaffold\Operations composer/Plugin/Scaffold/Operations/ReplaceOp.php Scaffold operation to copy or symlink from source to destination. 2
ReplaceOpTest class Drupal\Tests\Composer\Plugin\Scaffold\Integration core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ReplaceOpTest.php @coversDefaultClass \Drupal\Composer\Plugin\Scaffold\Operations\ReplaceOp[[api-linebreak]]
ReplaceTitleCommand class Drupal\views\Ajax core/modules/views/src/Ajax/ReplaceTitleCommand.php Provides an AJAX command for replacing the page title. 1
ReplicaKillSwitch class Drupal\Core\Database core/lib/Drupal/Core/Database/ReplicaKillSwitch.php Provides replica server kill switch to ignore it. 1 2
ReplicaKillSwitchTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/ReplicaKillSwitchTest.php Tests that ReplicaKillSwitch functions correctly.
ReportFieldsTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/ReportFieldsTest.php Tests the Views fields report page.
ReportTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/ReportTest.php Tests existence of the views plugin report.
RequestCloseSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/RequestCloseSubscriber.php Subscriber for all responses. 2
RequestContext class Drupal\Core\Routing core/lib/Drupal/Core/Routing/RequestContext.php Holds information about the current request. 11 2
RequestFormatCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/RequestFormatCacheContext.php Defines the RequestFormatCacheContext service, for "per format" caching. 2
RequestFormatRouteFilter class Drupal\Core\Routing core/lib/Drupal/Core/Routing/RequestFormatRouteFilter.php Provides a route filter, which filters by the request format. 1 2 2
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 14
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 class Drupal\Core\Http core/lib/Drupal/Core/Http/RequestStack.php Forward-compatibility shim for Symfony's RequestStack. 4 2
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
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

Other projects


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