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
OffsetPageTest class Drupal\Tests\jsonapi\Unit\Query core/modules/jsonapi/tests/src/Unit/Query/OffsetPageTest.php Tests Drupal\jsonapi\Query\OffsetPage.
OliveroAvoidStorageUsingTest final class Drupal\Tests\olivero\FunctionalJavascript core/themes/olivero/tests/src/FunctionalJavascript/OliveroAvoidStorageUsingTest.php Tests usage of localStorage.
OliveroAvoidStorageUsingTest final class Drupal\FunctionalJavascriptTests\Theme core/tests/Drupal/FunctionalJavascriptTests/Theme/OliveroAvoidStorageUsingTest.php Tests usage of localStorage.
OliveroHexToHslTest final class Drupal\Tests\olivero\Unit core/themes/olivero/tests/src/Unit/OliveroHexToHslTest.php Tests the \Drupal\olivero\HexToHslTrait:convertHexToHsl() function.
OliveroHooks class Drupal\olivero\Hook core/themes/olivero/src/Hook/OliveroHooks.php Hook implementations for olivero.
OliveroMessagesTest class Drupal\Tests\olivero\FunctionalJavascript core/themes/olivero/tests/src/FunctionalJavascript/OliveroMessagesTest.php Runs OliveroMessagesTest in Olivero.
OliveroMessagesTest class Drupal\FunctionalJavascriptTests\Theme core/tests/Drupal/FunctionalJavascriptTests/Theme/OliveroMessagesTest.php Runs OliveroMessagesTest in Olivero.
OliveroPagePreprocessHooks class Drupal\olivero\Hook core/themes/olivero/src/Hook/OliveroPagePreprocessHooks.php Page preprocess hooks for olivero.
OliveroPostUpdateTest class Drupal\Tests\olivero\Functional\Update core/themes/olivero/tests/src/Functional/Update/OliveroPostUpdateTest.php Tests the update path for Olivero.
OliveroPreRender class Drupal\olivero core/themes/olivero/src/OliveroPreRender.php Implements trusted prerender callbacks for the Olivero theme. 1
OliveroTest class Drupal\Tests\olivero\Functional core/themes/olivero/tests/src/Functional/OliveroTest.php Tests the Olivero theme.
OliveroTest class Drupal\FunctionalTests\Theme core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php Tests the Olivero theme.
OliveroTestThemeHooks class Drupal\olivero_test\Hook core/modules/system/tests/modules/olivero_test/src/Hook/OliveroTestThemeHooks.php Hook implementations for olivero_test.
OliveroTestThemeHooks class Drupal\olivero_test\Hook core/themes/olivero/tests/modules/olivero_test/src/Hook/OliveroTestThemeHooks.php Hook implementations for olivero_test.
OliveroThemeSettingsHooks class Drupal\olivero\Hook core/themes/olivero/src/Hook/OliveroThemeSettingsHooks.php Hook implementations for olivero.
OmittedData class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/OmittedData.php Represents resource data that should be omitted from the JSON:API document. 1
OnBehalfOfOtherModuleHook class Drupal\hook_collector_on_behalf\Hook core/modules/system/tests/modules/hook_collector_on_behalf/src/Hook/OnBehalfOfOtherModuleHook.php Hook implementation on behalf of another module.
OneTimeAuthentication final class Drupal\user core/modules/user/src/OneTimeAuthentication.php Generate and verify one time authentication codes. 14
OneTimeAuthenticationTest class Drupal\Tests\user\Kernel core/modules/user/tests/src/Kernel/OneTimeAuthenticationTest.php Tests OneTimeAuthentication service.
OpCodeCache class Drupal\Component\Utility core/lib/Drupal/Component/Utility/OpCodeCache.php Provides helpers to handle PHP opcode caches. 6
OpenDialogCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/OpenDialogCommand.php Defines an AJAX command to open certain content in a dialog. 2 3
OpenerResolver class Drupal\media_library core/modules/media_library/src/OpenerResolver.php Defines a class to resolve media library openers. 2
OpenerResolverInterface interface Drupal\media_library core/modules/media_library/src/OpenerResolverInterface.php Defines an interface to get a media library opener from the container. 1 3
OpenModalDialogCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php An AJAX command to open certain content in a dialog in a modal dialog. 5
OpenModalDialogWithUrl class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/OpenModalDialogWithUrl.php Provides an AJAX command for opening a modal with URL. 3
OpenOffCanvasDialogCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/OpenOffCanvasDialogCommand.php Defines an AJAX command to open content in a dialog in an off-canvas tray. 2
OpenOffCanvasDialogCommandTest class Drupal\Tests\Core\Ajax core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php Tests Drupal\Core\Ajax\OpenOffCanvasDialogCommand.
OpenTelemetryAuthenticatedPerformanceTest class Drupal\Tests\demo_umami\FunctionalJavascript core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php Tests demo_umami profile performance.
OpenTelemetryFrontPagePerformanceTest class Drupal\Tests\demo_umami\FunctionalJavascript core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php Tests demo_umami profile performance.
OpenTelemetryNodePagePerformanceTest class Drupal\Tests\demo_umami\FunctionalJavascript core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php Tests demo_umami profile performance.
OpenTelemetryPerformanceTest class Drupal\Tests\demo_umami\FunctionalJavascript core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryPerformanceTest.php Tests demo_umami profile performance.
OperationBase abstract class Drupal\image_test\Plugin\ImageToolkit\Operation\test core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/OperationBase.php Provides a base class for test operations. 5
OperationData class Drupal\Composer\Plugin\Scaffold\Operations composer/Plugin/Scaffold/Operations/OperationData.php Holds parameter data for operation objects during operation creation only. 1
OperationFactory class Drupal\Composer\Plugin\Scaffold\Operations composer/Plugin/Scaffold/Operations/OperationFactory.php Create Scaffold operation objects based on provided metadata. 1
OperationInterface interface Drupal\Composer\Plugin\Scaffold\Operations composer/Plugin/Scaffold/Operations/OperationInterface.php Interface for scaffold operation objects. 1 1
Operations class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Operations.php Provides a render element for a set of operations links.
Opml class Drupal\views\Plugin\views\style core/modules/views/src/Plugin/views/style/Opml.php Default style plugin to render an OPML feed.
OpmlFields class Drupal\views\Plugin\views\row core/modules/views/src/Plugin/views/row/OpmlFields.php Renders an OPML item based on fields.
OptGroup class Drupal\Core\Form core/lib/Drupal/Core/Form/OptGroup.php Provides helpers for HTML option groups. 6
OptGroupTest class Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/OptGroupTest.php Tests Drupal\Core\Form\OptGroup.
OptimizedPhpArrayDumper class Drupal\Component\DependencyInjection\Dumper core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php OptimizedPhpArrayDumper dumps a service container as a serialized PHP array. 1 1
OptimizedPhpArrayDumperTest class Drupal\Tests\Component\DependencyInjection\Dumper core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php Tests Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper. 1
OptionalConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/OptionalConstraint.php Marks a field as optional in a Collection constraint.
OptionalContextCondition class Drupal\condition_test\Plugin\Condition core/modules/system/tests/modules/condition_test/src/Plugin/Condition/OptionalContextCondition.php Provides a condition with an optional node context.
OptionalContextConditionTest class Drupal\KernelTests\Core\Plugin\Condition core/tests/Drupal/KernelTests/Core/Plugin/Condition/OptionalContextConditionTest.php Tests a condition with optional context.
OptionalServiceSystemTestController class Drupal\system_test\Controller core/modules/system/tests/modules/system_test/src/Controller/OptionalServiceSystemTestController.php A controller that specifies an optional dependency. 1
OptionsAllowedValues class Drupal\options core/modules/options/src/OptionsAllowedValues.php Provides allowed values for a list field. 1 2
OptionsAllowedValues class Drupal\options_test core/modules/options/tests/options_test/src/OptionsAllowedValues.php Provide allowed values callback.
OptionsAllowedValuesInterface interface Drupal\options core/modules/options/src/OptionsAllowedValuesInterface.php Provides an interface to get allowed values for a list field. 1 7
OptionsAllowedValuesTest class Drupal\Tests\options\Kernel core/modules/options/tests/src/Kernel/OptionsAllowedValuesTest.php Tests the caching of options allowed values.

Other projects


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