Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
RemoveCheckToStringNodeVisitor final class Drupal\Core\Template core/lib/Drupal/Core/Template/RemoveCheckToStringNodeVisitor.php Defines a TwigNodeVisitor that replaces CheckToStringNodes.
RemoveCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/RemoveCommand.php AJAX command for calling the jQuery remove() method. 3
RemovedPostUpdateNameException class Drupal\Core\Update core/lib/Drupal/Core/Update/RemovedPostUpdateNameException.php An exception thrown for removed post-update functions. 1
RemoveHook class Drupal\Core\Hook\Attribute core/lib/Drupal/Core/Hook/Attribute/RemoveHook.php Removes an already existing implementation. 10
RemovePathKeyTest class Drupal\Tests\system\Functional\Update core/modules/system/tests/src/Functional/Update/RemovePathKeyTest.php Tests the upgrade path for the system.file schema update.
RemoveRoleUser class Drupal\user\Plugin\Action core/modules/user/src/Plugin/Action/RemoveRoleUser.php Removes a role from a user. 1
RemoveRoleUserTest class Drupal\Tests\user\Unit\Plugin\Action core/modules/user/tests/src/Unit/Plugin/Action/RemoveRoleUserTest.php Tests Drupal\user\Plugin\Action\RemoveRoleUser.
RemoveSectionForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/RemoveSectionForm.php Provides a form to confirm the removal of a section. 1
RenderableInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/RenderableInterface.php Defines an object which can be rendered by the Render API. 4 6
RenderArrayNonHtmlSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/RenderArrayNonHtmlSubscriber.php Throws 406 if requesting non-HTML format and controller returns render array. 2
RenderArrayNonHtmlSubscriberTest class Drupal\Tests\system\Functional\Render core/modules/system/tests/src/Functional/Render/RenderArrayNonHtmlSubscriberTest.php Functional test verifying that render array throws 406 for non-HTML requests.
RenderArrayNonHtmlSubscriberTestController class Drupal\render_array_non_html_subscriber_test core/modules/system/tests/modules/render_array_non_html_subscriber_test/src/RenderArrayNonHtmlSubscriberTestController.php Controller for testing testing non-HTML requests.
RenderAttachedTestController class Drupal\render_attached_test\Controller core/modules/system/tests/modules/render_attached_test/src/Controller/RenderAttachedTestController.php Controller for various permutations of #attached in the render array. 1
RenderCache class Drupal\Core\Render core/lib/Drupal/Core/Render/RenderCache.php Wraps the caching logic for the render caching system. 1 1
RenderCacheIntegrationTest class Drupal\Tests\views\Kernel core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php Tests the general integration between views and the render cache.
RenderCacheInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/RenderCacheInterface.php Defines an interface for caching rendered render arrays. 1 5
RenderCacheWebTest class Drupal\Tests\views\Functional core/modules/views/tests/src/Functional/RenderCacheWebTest.php Tests render caching of blocks provided by views.
RenderCallbackInterface interface Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/RenderCallbackInterface.php Indicates all public methods are safe to use in render callbacks. 2 2
RenderCallbacks final class Drupal\navigation core/modules/navigation/src/RenderCallbacks.php Defines a class for render element callbacks. 1
RenderCallbacks final class Drupal\announcements_feed core/modules/announcements_feed/src/RenderCallbacks.php Defines a class for render callbacks. 1
RenderContext class Drupal\Core\Render core/lib/Drupal/Core/Render/RenderContext.php The render context: a stack containing bubbleable rendering metadata. 43
RenderedEntity class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/RenderedEntity.php Provides a field handler which renders an entity in a certain view mode. 1
RenderedEntityTest class Drupal\Tests\views\Unit\Plugin\views\field core/modules/views/tests/src/Unit/Plugin/views/field/RenderedEntityTest.php Tests Drupal\views\Plugin\views\field\RenderedEntity.
RenderElement class Drupal\Core\Render\Attribute core/lib/Drupal/Core/Render/Attribute/RenderElement.php Defines a Render element plugin attribute object. 1 37
RenderElement

in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Render\Element\RenderElementBase instead.

abstract class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/RenderElement.php Provides a base class for render element plugins. 1 1
RenderElement class Drupal\Core\Render\Annotation core/lib/Drupal/Core/Render/Annotation/RenderElement.php Defines a render element plugin annotation object. 1
RenderElementBase abstract class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/RenderElementBase.php Provides a base class for render element plugins. 33 16
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 Tests Drupal\Core\Render\Element\RenderElementBase.
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. 10 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 Tests Drupal\Core\Render\Renderer.
RendererCallbackTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php Tests Drupal\Core\Render\Renderer.
RendererDebugTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererDebugTest.php Tests Drupal\Core\Render\Renderer.
RendererInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/RendererInterface.php Defines an interface for turning a render array into a string. 1 90
RendererPlaceholdersTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php Tests Drupal\Core\Render\Renderer.
RendererRecursionTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php Tests Drupal\Core\Render\Renderer.
RendererTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererTest.php Tests Drupal\Core\Render\Renderer.
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 Provides a controller for testing render placeholders and message ordering. 2
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.
ReorderHook class Drupal\Core\Hook\Attribute core/lib/Drupal/Core/Hook/Attribute/ReorderHook.php Sets the order of an already existing implementation. 11
ReplaceCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/ReplaceCommand.php AJAX command for calling the jQuery replace() method. 14
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 Tests Drupal\Composer\Plugin\Scaffold\Operations\ReplaceOp.
ReplaceTitleCommand class Drupal\views\Ajax core/modules/views/src/Ajax/ReplaceTitleCommand.php Provides an AJAX command for replacing the page title. 1

Other projects


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