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
QueueWorkerManager class Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueWorkerManager.php Defines the queue worker manager. 2
QueueWorkerManagerInterface interface Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueWorkerManagerInterface.php Provides an interface for a queue worker manager. 1 3
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\Tests\Core\Command core/tests/Drupal/Tests/Core/Command/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. 2 2
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 class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Random.php Defines a utility class for creating random data. 30
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.
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\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 @coversDefaultClass \Drupal\views\Plugin\views\argument_default\Raw[[api-linebreak]] @group views
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().
Recipe final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/Recipe.php @internal This API is experimental. 12
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.
RecipeCommandTest class Drupal\FunctionalTests\Core\Recipe core/tests/Drupal/FunctionalTests/Core/Recipe/RecipeCommandTest.php @coversDefaultClass \Drupal\Core\Recipe\RecipeCommand[[api-linebreak]] @group Recipe
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 @coversDefaultClass \Drupal\Core\Recipe\RecipeConfigStorageWrapper[[api-linebreak]] @group Recipe
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 @coversDefaultClass \Drupal\Core\Recipe\RecipeConfigurator[[api-linebreak]] @group Recipe
RecipeEventsTest class Drupal\KernelTests\Core\Recipe core/tests/Drupal/KernelTests/Core/Recipe/RecipeEventsTest.php @group Recipe
RecipeExtensionConfigStorage final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeExtensionConfigStorage.php Allows the recipe to select configuration from the module.
RecipeFileException final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeFileException.php @internal This API is experimental. 3
RecipeMissingExtensionsException final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeMissingExtensionsException.php Exception thrown when recipes contain or depend on missing extensions.
RecipeOverrideConfigStorage final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeOverrideConfigStorage.php Wraps a config storage to allow recipe provided configuration to override it.
RecipePreExistingConfigException class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipePreExistingConfigException.php Exception thrown when a recipe has configuration that exists already. 2
RecipeQuickStartTest class Drupal\Tests\Core\Recipe core/tests/Drupal/Tests/Core/Recipe/RecipeQuickStartTest.php Tests the quick-start command with recipes.
RecipeRunner final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/RecipeRunner.php Applies a recipe. 12

Other projects


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