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
RandomGeneratorTrait trait Drupal\Tests core/tests/Drupal/Tests/RandomGeneratorTrait.php Provides random generator utility methods. 2
RandomTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/RandomTest.php Tests random data generation.
Range class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Range.php Provides a slider for input of a number within a specific range.
RangeConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraint.php Range constraint.
RangeConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraintValidator.php Validator for the Drupal 'range' constraint.
RangeQueryTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php Tests the Range query functionality.
Raw class Drupal\views\Plugin\views\argument_default core/modules/views/src/Plugin/views/argument_default/Raw.php Default argument plugin to use the raw value from the URL. 1
RawStringFormatterTest class Drupal\Tests\field\Kernel\String core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php Tests the raw string formatter.
RawTest class Drupal\Tests\views\Unit\Plugin\argument_default core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php @coversDefaultClass \Drupal\views\Plugin\views\argument_default\Raw[[api-linebreak]] @group views
RdfaAttributesTest class Drupal\Tests\rdf\Kernel core/modules/rdf/tests/src/Kernel/RdfaAttributesTest.php Tests RDFa attribute generation from RDF mapping.
RdfCommentStorageLoadTest class Drupal\Tests\rdf\Kernel core/modules/rdf/tests/src/Kernel/RdfCommentStorageLoadTest.php Tests rdf_comment_storage_load.
RdfMapping class Drupal\rdf\Entity core/modules/rdf/src/Entity/RdfMapping.php Config entity for working with RDF mappings. 4
RdfMapping class Drupal\rdf\Plugin\migrate\source\d7 core/modules/rdf/src/Plugin/migrate/source/d7/RdfMapping.php Drupal 7 rdf source from database.
RdfMappingConfigEntityUnitTest class Drupal\Tests\rdf\Unit core/modules/rdf/tests/src/Unit/RdfMappingConfigEntityUnitTest.php @coversDefaultClass \Drupal\rdf\Entity\RdfMapping[[api-linebreak]] @group rdf @group legacy
RdfMappingHalJsonAnonTest class Drupal\Tests\hal\Functional\rdf core/modules/hal/tests/src/Functional/rdf/RdfMappingHalJsonAnonTest.php @group hal @group legacy
RdfMappingHalJsonBasicAuthTest class Drupal\Tests\hal\Functional\rdf core/modules/hal/tests/src/Functional/rdf/RdfMappingHalJsonBasicAuthTest.php @group hal @group legacy
RdfMappingHalJsonCookieTest class Drupal\Tests\hal\Functional\rdf core/modules/hal/tests/src/Functional/rdf/RdfMappingHalJsonCookieTest.php @group hal @group legacy
RdfMappingInterface interface Drupal\rdf core/modules/rdf/src/RdfMappingInterface.php Provides an interface defining an RDF mapping entity. 1 2
RdfMappingJsonAnonTest class Drupal\Tests\rdf\Functional\Rest core/modules/rdf/tests/src/Functional/Rest/RdfMappingJsonAnonTest.php @group rest @group legacy
RdfMappingJsonBasicAuthTest class Drupal\Tests\rdf\Functional\Rest core/modules/rdf/tests/src/Functional/Rest/RdfMappingJsonBasicAuthTest.php @group rest @group legacy
RdfMappingJsonCookieTest class Drupal\Tests\rdf\Functional\Rest core/modules/rdf/tests/src/Functional/Rest/RdfMappingJsonCookieTest.php @group rest @group legacy
RdfMappingResourceTestBase abstract class Drupal\Tests\rdf\Functional\Rest core/modules/rdf/tests/src/Functional/Rest/RdfMappingResourceTestBase.php 9 3
RdfMappingTest class Drupal\Tests\rdf\Kernel\Plugin\migrate\source\d7 core/modules/rdf/tests/src/Kernel/Plugin/migrate/source/d7/RdfMappingTest.php Tests Drupal 7 RDF mappings source plugin.
RdfMappingTest class Drupal\Tests\rdf\Functional\Jsonapi core/modules/rdf/tests/src/Functional/Jsonapi/RdfMappingTest.php JSON:API integration test for the "RdfMapping" config entity type.
RdfMappingXmlAnonTest class Drupal\Tests\rdf\Functional\Rest core/modules/rdf/tests/src/Functional/Rest/RdfMappingXmlAnonTest.php @group rest @group legacy
RdfMappingXmlBasicAuthTest class Drupal\Tests\rdf\Functional\Rest core/modules/rdf/tests/src/Functional/Rest/RdfMappingXmlBasicAuthTest.php @group rest @group legacy
RdfMappingXmlCookieTest class Drupal\Tests\rdf\Functional\Rest core/modules/rdf/tests/src/Functional/Rest/RdfMappingXmlCookieTest.php @group rest @group legacy
RdfParsingTrait trait Drupal\Tests\rdf\Traits core/modules/rdf/tests/src/Traits/RdfParsingTrait.php Defines a trait for parsing RDF properties from HTML. 9
ReadOnlyException class Drupal\Core\TypedData\Exception core/lib/Drupal/Core/TypedData/Exception/ReadOnlyException.php Exception thrown when trying to write or set ready-only data.
ReadOnlyModeMethodFilter class Drupal\jsonapi\Routing core/modules/jsonapi/src/Routing/ReadOnlyModeMethodFilter.php Filters routes based on the HTTP method and JSON:API's read-only mode. 2
ReadOnlyStorage class Drupal\Core\Config core/lib/Drupal/Core/Config/ReadOnlyStorage.php A ReadOnlyStorage decorates a storage and does not allow writing to it. 1
ReadOnlyStorageTest class Drupal\Tests\Core\Config core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php @coversDefaultClass \Drupal\Core\Config\ReadOnlyStorage[[api-linebreak]] @group Config
ReadOnlyStream abstract class Drupal\Core\StreamWrapper core/lib/Drupal/Core/StreamWrapper/ReadOnlyStream.php Defines a read-only Drupal stream wrapper base class. 1 1
ReadOnlyStreamWrapperTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php Tests the read-only stream wrapper write functions.
Rearrange class Drupal\views_ui\Form\Ajax core/modules/views_ui/src/Form/Ajax/Rearrange.php Provides a rearrange form for Views handlers.
RearrangeFieldsTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php Tests the reordering of fields via AJAX.
RearrangeFilter class Drupal\views_ui\Form\Ajax core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php Provides a rearrange form for Views filters. 1
RearrangeFilterTest class Drupal\Tests\views_ui\Unit\Form\Ajax core/modules/views_ui/tests/src/Unit/Form/Ajax/RearrangeFilterTest.php Unit tests for Views UI module functions.
RebuildPermissionsForm class Drupal\node\Form core/modules/node/src/Form/RebuildPermissionsForm.php Form for rebuilding permissions. 1
RebuildScriptTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/RebuildScriptTest.php Tests the rebuild script access and functionality.
RebuildTest class Drupal\Tests\system\FunctionalJavascript\Form core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php Tests functionality of \Drupal\Core\Form\FormBuilderInterface::rebuildForm().
RebuildTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/RebuildTest.php Tests functionality of \Drupal\Core\Form\FormBuilderInterface::rebuildForm().
Rectangle class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Rectangle.php Rectangle rotation algebra class. 2
RectangleTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/RectangleTest.php @coversDefaultClass \Drupal\Component\Utility\Rectangle[[api-linebreak]] @group Image
RecursiveContextualValidator class Drupal\Core\TypedData\Validation core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php Defines a recursive contextual validator for Typed Data.
RecursiveContextualValidatorTest class Drupal\KernelTests\Core\TypedData core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php @coversDefaultClass \Drupal\Core\TypedData\Validation\RecursiveContextualValidator[[api-linebreak]] @group Validation
RecursiveContextualValidatorTest class Drupal\Tests\Core\TypedData core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php @coversDefaultClass \Drupal\Core\TypedData\Validation\RecursiveContextualValidator[[api-linebreak]] @group typedData
RecursiveExtensionFilterIterator class Drupal\Core\Extension\Discovery core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php Filters a RecursiveDirectoryIterator to discover extensions. 1
RecursivePlaceholdersTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
RecursiveValidator class Drupal\Core\TypedData\Validation core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php Defines a recursive validator for Typed Data. 2

Other projects


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