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
QuickStartCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/QuickStartCommand.php Installs a Drupal site and starts a webserver for local testing/development.
QuickStartTest class Drupal\BuildTests\QuickStart core/tests/Drupal/BuildTests/QuickStart/QuickStartTest.php Tests the quick-start commands.
QuickStartTestBase abstract class Drupal\BuildTests\QuickStart core/tests/Drupal/BuildTests/QuickStart/QuickStartTestBase.php Helper methods for using the quickstart feature of Drupal. 3 3
QuxTest abstract class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-classes-with-metadata.php
Radio class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Radio.php Provides a form element for a single radio button.
Radios class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Radios.php Provides a form element for a set of radio buttons. 1
Random abstract class Drupal\TestTools core/tests/Drupal/TestTools/Random.php Provides random generator utility static methods. 20
Random class Drupal\views\Plugin\views\sort core/modules/views/src/Plugin/views/sort/Random.php Handle a random sort.
Random class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Random.php Defines a utility class for creating random data. 30 1
RandomGeneratorTrait trait Drupal\Tests core/tests/Drupal/Tests/RandomGeneratorTrait.php Provides random generator utility methods. 3
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. 1 1
RangeConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraintValidator.php Validator for the Drupal 'range' constraint. 1 1
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
RawConfigWriterTrait trait Drupal\Tests\Traits\Core\Config core/tests/Drupal/Tests/Traits/Core/Config/RawConfigWriterTrait.php Allows writing raw config data for testing purposes. 1
RawStringFormatterTest class Drupal\Tests\field\Kernel\KernelString core/modules/field/tests/src/Kernel/KernelString/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 Tests Drupal\views\Plugin\views\argument_default\Raw.
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 Tests Drupal\Core\Config\ReadOnlyStorage.
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\Functional\Form core/modules/system/tests/src/Functional/Form/RebuildTest.php Tests functionality of \Drupal\Core\Form\FormBuilderInterface::rebuildForm().
RebuildTest class Drupal\Tests\system\FunctionalJavascript\Form core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php Tests functionality of \Drupal\Core\Form\FormBuilderInterface::rebuildForm().
Recipe final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/Recipe.php @internal This API is experimental. 17
RecipeAppliedEvent final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeAppliedEvent.php Event dispatched after a recipe has been applied. 1
RecipeCommand final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeCommand.php Applies recipe.
RecipeCommand final class Drupal\Core\Recipe\Command core/lib/Drupal/Core/Recipe/Command/RecipeCommand.php Applies recipe. 1
RecipeCommandTest class Drupal\FunctionalTests\Core\Recipe core/tests/Drupal/FunctionalTests/Core/Recipe/RecipeCommandTest.php Tests recipe command.
RecipeConfigInstaller final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeConfigInstaller.php Extends the ConfigInstaller service for recipes.
RecipeConfigStorageWrapper final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeConfigStorageWrapper.php Merges two storages together. 1
RecipeConfigStorageWrapperTest class Drupal\Tests\Core\Recipe core/tests/Drupal/Tests/Core/Recipe/RecipeConfigStorageWrapperTest.php Tests Drupal\Core\Recipe\RecipeConfigStorageWrapper.
RecipeConfigurator final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeConfigurator.php @internal This API is experimental. 1
RecipeConfiguratorTest class Drupal\KernelTests\Core\Recipe core/tests/Drupal/KernelTests/Core/Recipe/RecipeConfiguratorTest.php Tests Drupal\Core\Recipe\RecipeConfigurator.
RecipeEventsTest class Drupal\KernelTests\Core\Recipe core/tests/Drupal/KernelTests/Core/Recipe/RecipeEventsTest.php Tests Recipe Events.
RecipeFileException final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeFileException.php @internal This API is experimental. 3
RecipeFormInputTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/RecipeFormInputTest.php Tests Recipe Form Input.
RecipeInfoCommand final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeInfoCommand.php Shows information about a particular recipe.
RecipeInfoCommand final class Drupal\Core\Recipe\Command core/lib/Drupal/Core/Recipe/Command/RecipeInfoCommand.php Shows information about a particular recipe.
RecipeInputFormTrait trait Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeInputFormTrait.php Defines helper methods for forms which collect input on behalf of recipes. 2
RecipeMissingExtensionsException final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeMissingExtensionsException.php Exception thrown when recipes contain or depend on missing extensions.

Other projects


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