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
OptionsButtonsWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsButtonsWidget.php Plugin implementation of the 'options_buttons' widget.
OptionsDefaultFormatter class Drupal\options\Plugin\Field\FieldFormatter core/modules/options/src/Plugin/Field/FieldFormatter/OptionsDefaultFormatter.php Plugin implementation of the 'list_default' formatter.
OptionsDynamicValuesApiTest class Drupal\Tests\options\Kernel core/modules/options/tests/src/Kernel/OptionsDynamicValuesApiTest.php Tests the options allowed values api.
OptionsDynamicValuesTestBase abstract class Drupal\Tests\options\Functional core/modules/options/tests/src/Functional/OptionsDynamicValuesTestBase.php Base class for testing allowed values of options fields. 1
OptionsDynamicValuesValidationTest class Drupal\Tests\options\Kernel core/modules/options/tests/src/Kernel/OptionsDynamicValuesValidationTest.php Tests the Options field allowed values function.
OptionsEnumTrait trait Drupal\Core\Utility core/lib/Drupal/Core/Utility/OptionsEnumTrait.php Helper functions to translate enum cases into an array of options. 7
OptionsField class Drupal\options\Plugin\migrate\field\d7 core/modules/options/src/Plugin/migrate/field/d7/OptionsField.php Migrate field plugin for Drupal 7 options fields.
OptionsFieldTest class Drupal\Tests\options\Kernel core/modules/options/tests/src/Kernel/OptionsFieldTest.php Tests for the 'Options' field types.
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. 6
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.
OptionsSelectNoMultipleWidget class Drupal\options_test\Plugin\Field\FieldWidget core/modules/options/tests/options_test/src/Plugin/Field/FieldWidget/OptionsSelectNoMultipleWidget.php Widget extending OptionsSelectWidget without declaring multiple_values.
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. 2 2
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 1
OptionsWidgetBaseTest class Drupal\Tests\options\Kernel core/modules/options/tests/src/Kernel/OptionsWidgetBaseTest.php Tests OptionsWidgetBase.
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. 4
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.

Other projects


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