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
RedirectCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/RedirectCommand.php Defines an AJAX command to set the window.location, loading that URL. 4
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 17
RedirectDestinationTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php Tests Drupal\Core\Routing\RedirectDestination.
RedirectDestinationTrait trait Drupal\Core\Routing core/lib/Drupal/Core/Routing/RedirectDestinationTrait.php Wrapper methods for the Redirect Destination. 12
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. 4 2
RedirectResponseSubscriberTest class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php Tests Drupal\Core\EventSubscriber\RedirectResponseSubscriber.
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.
RedundantEditableConfigNamesTrait trait Drupal\Core\Form core/lib/Drupal/Core/Form/RedundantEditableConfigNamesTrait.php Implements ::getEditableConfigNames() for forms using #config_target. 8
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. 13 28
RefinableCacheableDependencyTrait trait Drupal\Core\Cache core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php Trait for \Drupal\Core\Cache\RefinableCacheableDependencyInterface. 12
RefinableCacheableDependencyTraitTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/RefinableCacheableDependencyTraitTest.php Tests the cache RefinableCacheableDependencyTrait.
RefinableCalculatedPermissions class Drupal\Core\Session core/lib/Drupal/Core/Session/RefinableCalculatedPermissions.php Represents a calculated set of permissions with cacheable metadata. 6
RefinableCalculatedPermissionsInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php Defines the refinable calculated permissions interface. 1 2
RefinableCalculatedPermissionsTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/RefinableCalculatedPermissionsTest.php Tests the RefinableCalculatedPermissions class.
RefinableDependentAccessInterface interface Drupal\Core\Access core/lib/Drupal/Core/Access/RefinableDependentAccessInterface.php An interface to allow adding an access dependency. 4 5
RefinableDependentAccessTrait trait Drupal\Core\Access core/lib/Drupal/Core/Access/RefinableDependentAccessTrait.php Trait for \Drupal\Core\Access\RefinableDependentAccessInterface. 3
RefinableDependentAccessTraitTestClass class Drupal\Tests\Core\Access core/tests/Drupal/Tests/Core/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
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 Tests Drupal\Component\Plugin\Factory\ReflectionFactory.
ReflectionTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/ReflectionTest.php Tests Drupal\Component\Utility\Reflection.
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. 1 2
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 Tests Drupal\Component\FileSystem\RegexDirectoryIterator.
RegexRecursiveFilterIterator class Drupal\Core\Plugin\Discovery core/lib/Drupal/Core/Plugin/Discovery/RegexRecursiveFilterIterator.php Iterates over files whose names match a regular expression in a directory.
RegionalForm class Drupal\system\Form core/modules/system/src/Form/RegionalForm.php Configure regional settings for this site. 1 1
RegionalSettingsFormTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/RegionalSettingsFormTest.php Tests the system_regional_settings form.
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 Wraps the Symfony event subscriber pass to use different tag names. 1
RegisterForm class Drupal\user core/modules/user/src/RegisterForm.php Form handler for the user register forms. 1
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
RegisterSerializationClassesCompilerPass class Drupal\serialization core/modules/serialization/src/RegisterSerializationClassesCompilerPass.php Adds services tagged 'normalizer' and 'encoder' to the Serializer. 1 2
RegisterSerializationClassesCompilerPassTest class Drupal\Tests\serialization\Unit\CompilerPass core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php Tests Drupal\serialization\RegisterSerializationClassesCompilerPass.
RegisterServicesForDestructionPass class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterServicesForDestructionPass.php Adds services to the "kernel.destructable_services" container parameter. 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.
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. 9 2
RegistryTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php Tests the behavior of the ThemeRegistry class.

Other projects


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