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
RedirectBlockForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/RedirectBlockForm.php Builds a simple form that redirects on submit.
RedirectCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/RedirectCommand.php Defines an AJAX command to set the window.location, loading that URL. 2
RedirectDestination class Drupal\Core\Routing core/lib/Drupal/Core/Routing/RedirectDestination.php Provides helpers for redirect destinations. 1 2
RedirectDestinationInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/RedirectDestinationInterface.php Provides an interface for redirect destinations. 1 8
RedirectDestinationTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php @coversDefaultClass \Drupal\Core\Routing\RedirectDestination[[api-linebreak]] @group Routing
RedirectDestinationTrait trait Drupal\Core\Routing core/lib/Drupal/Core/Routing/RedirectDestinationTrait.php Wrapper methods for the Redirect Destination. 10
RedirectFormBlock class Drupal\form_test\Plugin\Block core/modules/system/tests/modules/form_test/src/Plugin/Block/RedirectFormBlock.php Provides a block containing a simple redirect form.
RedirectLeadingSlashesSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/RedirectLeadingSlashesSubscriber.php Redirects paths containing successive slashes to those with single slashes. 2
RedirectOnExceptionTest class Drupal\KernelTests\RequestProcessing core/tests/Drupal/KernelTests/RequestProcessing/RedirectOnExceptionTest.php Tests redirects on exception pages.
RedirectResponseSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php Allows manipulation of the response object when performing a redirect. 1 2
RedirectResponseSubscriberTest class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php @coversDefaultClass \Drupal\Core\EventSubscriber\RedirectResponseSubscriber[[api-linebreak]] @group EventSubscriber
RedirectTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/RedirectTest.php Tests the redirecting after saving a views.
RedirectTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/RedirectTest.php Tests form redirection functionality.
ReEnableModuleFieldTest class Drupal\Tests\field\Functional core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php Tests the behavior of a field module after being disabled and re-enabled.
ReferenceAccessConstraint class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ReferenceAccessConstraint.php Entity Reference valid reference constraint.
ReferenceAccessConstraintValidator class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ReferenceAccessConstraintValidator.php Checks if the current user has access to newly referenced entities.
ReferenceBase abstract class Drupal\migrate_drupal\Plugin\migrate\field core/modules/migrate_drupal/src/Plugin/migrate/field/ReferenceBase.php Base class for Drupal reference fields. 4 4
RefinableCacheableDependencyInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/RefinableCacheableDependencyInterface.php Allows to add cacheability metadata to an object for the current runtime. 9 22
RefinableCacheableDependencyTrait trait Drupal\Core\Cache core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php Trait for \Drupal\Core\Cache\RefinableCacheableDependencyInterface. 8
RefinableDependentAccessInterface interface Drupal\block_content\Access core/modules/block_content/src/Access/RefinableDependentAccessInterface.php An interface to allow adding an access dependency. 4 5
RefinableDependentAccessTrait trait Drupal\block_content\Access core/modules/block_content/src/Access/RefinableDependentAccessTrait.php Trait for \Drupal\block_content\Access\RefinableDependentAccessInterface. 3
RefinableDependentAccessTraitTestClass class Drupal\Tests\block_content\Unit\Access core/modules/block_content/tests/src/Unit/Access/DependentAccessTest.php Test class that implements RefinableDependentAccessInterface.
Reflection final class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Reflection.php Provides helper methods for reflection. 3
ReflectionClass trait Drupal\Component\Annotation\Doctrine\Compatibility\Php8 core/lib/Drupal/Component/Annotation/Doctrine/Compatibility/Php8/ReflectionClass.php
ReflectionClass trait Drupal\Component\Annotation\Doctrine\Compatibility\Php7 core/lib/Drupal/Component/Annotation/Doctrine/Compatibility/Php7/ReflectionClass.php
ReflectionFactory class Drupal\Component\Plugin\Factory core/lib/Drupal/Component/Plugin/Factory/ReflectionFactory.php A plugin factory that maps instance configuration to constructor arguments. 1 2
ReflectionFactoryTest class Drupal\Tests\Component\Plugin\Factory core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php @group Plugin @coversDefaultClass \Drupal\Component\Plugin\Factory\ReflectionFactory[[api-linebreak]]
ReflectionTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/ReflectionTest.php @coversDefaultClass \Drupal\Component\Utility\Reflection[[api-linebreak]] @group Utility
RefreshVariablesTrait trait Drupal\Core\Test core/lib/Drupal/Core/Test/RefreshVariablesTrait.php Provides a method to refresh in-memory configuration and state information. 1
RegexConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RegexConstraint.php Regex constraint.
RegexDirectoryIterator class Drupal\Component\FileSystem core/lib/Drupal/Component/FileSystem/RegexDirectoryIterator.php Iterates over files whose names match a regular expression in a directory. 3
RegexDirectoryIteratorTest class Drupal\Tests\Component\FileSystem core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php @coversDefaultClass \Drupal\Component\FileSystem\RegexDirectoryIterator[[api-linebreak]] @group FileSystem
RegionalForm class Drupal\system\Form core/modules/system/src/Form/RegionalForm.php Configure regional settings for this site. 1
RegisterAccessCheck class Drupal\user\Access core/modules/user/src/Access/RegisterAccessCheck.php Access check for user registration routes. 2
RegisterAccessChecksPass class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterAccessChecksPass.php Adds services tagged 'access_check' to the access_manager service. 1
RegisterEntityResolversCompilerPass class Drupal\serialization core/modules/serialization/src/RegisterEntityResolversCompilerPass.php Adds services tagged 'entity_resolver' to the Serializer.
RegisterEventSubscribersPass class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterEventSubscribersPass.php Registers all event subscribers to the event dispatcher. 1
RegisterForm class Drupal\user core/modules/user/src/RegisterForm.php Form handler for the user register forms.
RegisterSerializationClassesCompilerPass class Drupal\serialization core/modules/serialization/src/RegisterSerializationClassesCompilerPass.php Adds services tagged 'normalizer' and 'encoder' to the Serializer. 1 2
RegisterSerializationClassesCompilerPass class Drupal\jsonapi\DependencyInjection\Compiler core/modules/jsonapi/src/DependencyInjection/Compiler/RegisterSerializationClassesCompilerPass.php Adds services tagged JSON:API-only normalizers to the Serializer. 1
RegisterSerializationClassesCompilerPassTest class Drupal\Tests\serialization\Unit\CompilerPass core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php @coversDefaultClass \Drupal\serialization\RegisterSerializationClassesCompilerPass[[api-linebreak]] @group serialization
RegisterServicesForDestructionPass class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForDestructionPass.php Adds services with specific tags to "kernel_destruct_subscriber" service. 1
RegisterStreamWrappersPass class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterStreamWrappersPass.php Adds services tagged 'stream_wrapper' to the stream_wrapper_manager service. 1
RegistrationWithUserFieldsTest class Drupal\Tests\user\FunctionalJavascript core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php Tests user registration forms with additional fields.
Registry class Drupal\Core\Theme core/lib/Drupal/Core/Theme/Registry.php Defines the theme registry service. 10 2
RegistryLegacyTest class Drupal\Tests\Core\Theme core/tests/Drupal/Tests/Core/Theme/RegistryLegacyTest.php @coversDefaultClass \Drupal\Core\Theme\Registry[[api-linebreak]] @group Theme @group legacy
RegistryLegacyTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/RegistryLegacyTest.php Tests legacy behavior of the ThemeRegistry class.
RegistryTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php Tests the behavior of the ThemeRegistry class.
RegistryTest class Drupal\Tests\Core\Theme core/tests/Drupal/Tests/Core/Theme/RegistryTest.php @coversDefaultClass \Drupal\Core\Theme\Registry[[api-linebreak]] @group Theme 1
RegressionTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php Regression tests cases for the database layer.

Other projects


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