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
OptionsFieldUIAllowedValuesTest class Drupal\Tests\options\FunctionalJavascript core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUIAllowedValuesTest.php Tests the Options field allowed values UI functionality.
OptionsFieldUITest class Drupal\Tests\options\FunctionalJavascript core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUITest.php Tests the Options field UI functionality.
OptionsFieldUITest class Drupal\Tests\options\Functional core/modules/options/tests/src/Functional/OptionsFieldUITest.php Tests the Options field UI functionality.
OptionsFieldUnitTestBase abstract class Drupal\Tests\options\Kernel core/modules/options/tests/src/Kernel/OptionsFieldUnitTestBase.php Base class for Options module integration tests. 4
OptionsFloatFieldImportTest class Drupal\Tests\options\Functional core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php Tests option fields can be updated and created by config synchronization.
OptionsFormattersTest class Drupal\Tests\options\Kernel core/modules/options/tests/src/Kernel/OptionsFormattersTest.php Tests the Options field type formatters.
OptionsHooks class Drupal\options\Hook core/modules/options/src/Hook/OptionsHooks.php Hook implementations for options.
OptionsKeyFormatter class Drupal\options\Plugin\Field\FieldFormatter core/modules/options/src/Plugin/Field/FieldFormatter/OptionsKeyFormatter.php Plugin implementation of the 'list_key' formatter.
OptionsListArgumentTest class Drupal\Tests\options\Kernel\Views core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php Tests options list argument for views.
OptionsListFilterTest class Drupal\Tests\options\Kernel\Views core/modules/options/tests/src/Kernel/Views/OptionsListFilterTest.php Tests options list filter for views.
OptionsProviderInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/OptionsProviderInterface.php Interface for retrieving all possible and settable values. 5 9
OptionsRequestSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/OptionsRequestSubscriber.php Handles options requests. 1 2
OptionsRequestSubscriberTest class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/OptionsRequestSubscriberTest.php Tests Drupal\Core\EventSubscriber\OptionsRequestSubscriber.
OptionsSelectDynamicValuesTest class Drupal\Tests\options\Functional core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php Tests an options select with a dynamic allowed values function.
OptionsSelectWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php Plugin implementation of the 'options_select' widget. 1 1
OptionsTestBase abstract class Drupal\Tests\options\Kernel\Views core/modules/options/tests/src/Kernel/Views/OptionsTestBase.php Base class for options views tests. 3
OptionsTestHooks class Drupal\options_test\Hook core/modules/options/tests/options_test/src/Hook/OptionsTestHooks.php Hook implementations for options_test.
OptionsViewsHooks class Drupal\options\Hook core/modules/options/src/Hook/OptionsViewsHooks.php Hook implementations for options.
OptionsWidgetBase abstract class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php Base class for the 'options_*' widgets. 2
OptionsWidgetsTest class Drupal\Tests\options\Functional core/modules/options/tests/src/Functional/OptionsWidgetsTest.php Tests the Options widgets.
OptionWidgetsField class Drupal\options\Plugin\migrate\field\d6 core/modules/options/src/Plugin/migrate/field/d6/OptionWidgetsField.php MigrateField Plugin for Drupal 6 options fields.
Orange class Drupal\plugin_test\Plugin\plugin_test\fruit core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/Orange.php Plugin annotation @Plugin( id = "orange", label = "Orange", color = "orange" )
OrderAfter class Drupal\Core\Hook\Order core/lib/Drupal/Core/Hook/Order/OrderAfter.php Set this implementation to be after others. 9
OrderBefore class Drupal\Core\Hook\Order core/lib/Drupal/Core/Hook/Order/OrderBefore.php Set this implementation to be before others. 3
OrderByTest class Drupal\Tests\Core\Database core/tests/Drupal/Tests/Core/Database/OrderByTest.php Tests the orderBy() method of select queries.
OrderInterface interface Drupal\Core\Hook\Order core/lib/Drupal/Core/Hook/Order/OrderInterface.php Interface for order specifiers used in hook attributes. 1 2
OrderOperation abstract class Drupal\Core\Hook\OrderOperation core/lib/Drupal/Core/Hook/OrderOperation/OrderOperation.php Base class for order operations. 2 5
OriginatorSubscriber class Drupal\Core\Mailer\EventSubscriber core/lib/Drupal/Core/Mailer/EventSubscriber/OriginatorSubscriber.php Message subscriber which sets the from and sender headers. 1
OriginatorSubscriberTest class Drupal\Tests\mailer\Kernel core/modules/mailer/tests/src/Kernel/OriginatorSubscriberTest.php Tests default originator subscriber.
OtherModuleInstalledHooks class Drupal\respond_install_uninstall_hook_test\Hook core/modules/system/tests/modules/respond_install_uninstall_hook_test/src/Hook/OtherModuleInstalledHooks.php Hook implementations for respond_install_uninstall_hook_test.
OtherModuleUninstalledHooks class Drupal\respond_install_uninstall_hook_test\Hook core/modules/system/tests/modules/respond_install_uninstall_hook_test/src/Hook/OtherModuleUninstalledHooks.php Hook implementations for respond_install_uninstall_hook_test.
OutboundPathProcessorInterface interface Drupal\Core\PathProcessor core/lib/Drupal/Core/PathProcessor/OutboundPathProcessorInterface.php Defines an interface for classes that process the outbound path. 8 11
OutboundRouteProcessorInterface interface Drupal\Core\RouteProcessor core/lib/Drupal/Core/RouteProcessor/OutboundRouteProcessorInterface.php Defines an interface for classes that process the outbound route. 3 2
OutputStrategyInterface interface Drupal\Component\Render core/lib/Drupal/Component/Render/OutputStrategyInterface.php Provides an output strategy that formats HTML strings for a given context. 1
OverlapWithTopLevelDependenciesTest class Drupal\Tests\Composer\Generator core/tests/Drupal/Tests/Composer/Generator/OverlapWithTopLevelDependenciesTest.php Tests DrupalCoreRecommendedBuilder.
OverriddenConfigImportTest class Drupal\Tests\language\Kernel core/modules/language/tests/src/Kernel/OverriddenConfigImportTest.php Tests importing of config with language overrides.
OverriddenConfigurationTest class Drupal\Tests\settings_tray\FunctionalJavascript core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php Tests handling of configuration overrides.
OverrideDisplaysTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php Tests that displays can be correctly overridden via the user interface.
OverrideMenuLinks final class Drupal\Core\Menu\Plugin\ConfigAction core/lib/Drupal/Core/Menu/Plugin/ConfigAction/OverrideMenuLinks.php Overrides static menu links defined in code. 1
OverrideMenuLinksConfigActionTest final class Drupal\KernelTests\Core\Menu core/tests/Drupal/KernelTests/Core/Menu/OverrideMenuLinksConfigActionTest.php Tests overriding static menu links with config actions.
OverrideSectionsTest class Drupal\Tests\layout_builder\Functional\Rest core/modules/layout_builder/tests/src/Functional/Rest/OverrideSectionsTest.php Tests that override layout sections are not exposed via the REST API.
OverridesEntityForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/OverridesEntityForm.php Provides a form containing the Layout Builder UI for overrides. 1
OverridesSectionStorage class Drupal\layout_builder\Plugin\SectionStorage core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php Defines the 'overrides' section storage type. 16
OverridesSectionStorageInterface interface Drupal\layout_builder core/modules/layout_builder/src/OverridesSectionStorageInterface.php Defines an interface for an object that stores layout sections for overrides. 1 6
OverridesSectionStorageTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/OverridesSectionStorageTest.php Tests Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage.
OverridesSectionStorageTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php Tests Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage.
OverviewForm class Drupal\migrate_drupal_ui\Form core/modules/migrate_drupal_ui/src/Form/OverviewForm.php Migrate Upgrade Overview form. 1
OverviewTerms class Drupal\taxonomy\Form core/modules/taxonomy/src/Form/OverviewTerms.php Provides terms overview form for a taxonomy vocabulary. 1 2
OverviewTermsOverride class Drupal\taxonomy_overview_override_test\Form core/modules/taxonomy/tests/modules/taxonomy_overview_override_test/src/Form/OverviewTermsOverride.php Provides an overview form to test overriding it via hook_entity_type_alter. 1
OverwriteExistingPackagesValidator final class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/OverwriteExistingPackagesValidator.php Validates that newly installed packages don't overwrite existing directories. 1

Other projects


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