Classes, traits, and interfaces - 10.3.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 1518

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 through config synchronization.
OptionsFormattersTest class Drupal\Tests\options\Kernel core/modules/options/tests/src/Kernel/OptionsFormattersTest.php Tests the Options field type formatters.
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 @coversDefaultClass \Drupal\Core\EventSubscriber\OptionsRequestSubscriber[[api-linebreak]] @group EventSubscriber
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
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" )
OrderByTest class Drupal\Tests\Core\Database core/tests/Drupal/Tests/Core/Database/OrderByTest.php Tests the orderBy() method of select queries.
OutboundPathProcessorInterface interface Drupal\Core\PathProcessor core/lib/Drupal/Core/PathProcessor/OutboundPathProcessorInterface.php Defines an interface for classes that process the outbound path. 9 10
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.
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. 14
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 @coversDefaultClass \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage[[api-linebreak]]
OverridesSectionStorageTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php @coversDefaultClass \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage[[api-linebreak]]
Overview class Drupal\forum\Form core/modules/forum/src/Form/Overview.php Provides forum overview form for the forum vocabulary. 1
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 1
PackageGenerator class Drupal\Composer\Generator composer/Generator/PackageGenerator.php Generates metapackages. 2
Page class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Page.php Provides a render element for the content of an HTML page.
Page class Drupal\views\Plugin\views\display core/modules/views/src/Plugin/views/display/Page.php The plugin that handles a full page. 4
PageCache class Drupal\page_cache\StackMiddleware core/modules/page_cache/src/StackMiddleware/PageCache.php Executes the page caching before the main kernel takes over the request. 2
PageCacheAcceptHeaderController class Drupal\system_test\Controller core/modules/system/tests/modules/system_test/src/Controller/PageCacheAcceptHeaderController.php Defines a controller to respond the page cache accept header test.
PageCacheTagsIntegrationTest class Drupal\Tests\page_cache\Functional core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php Enables the page cache and tests its cache tags in various scenarios.
PageCacheTagsTestBase abstract class Drupal\Tests\system\Functional\Cache core/modules/system/tests/src/Functional/Cache/PageCacheTagsTestBase.php Provides helper methods for page cache tags tests. 5 5
PageCacheTest class Drupal\Tests\page_cache\Functional core/modules/page_cache/tests/src/Functional/PageCacheTest.php Enables the page cache and tests it with various HTTP requests.
PageDisplayVariant class Drupal\Core\Display\Attribute core/lib/Drupal/Core/Display/Attribute/PageDisplayVariant.php Defines a page display variant attribute object. 2
PageDisplayVariant class Drupal\Core\Display\Annotation core/lib/Drupal/Core/Display/Annotation/PageDisplayVariant.php Defines a page display variant annotation object.
PageDisplayVariantSelectionEvent class Drupal\Core\Render core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php Event fired when rendering main content, to select a page display variant. 3
PageEditTest class Drupal\Tests\block_content\Functional core/modules/block_content/tests/src/Functional/PageEditTest.php Create a block and test block edit functionality.
PageNotFoundTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/PageNotFoundTest.php Tests page not found functionality, including custom 404 pages.
PagePreviewTest class Drupal\Tests\node\Functional core/modules/node/tests/src/Functional/PagePreviewTest.php Tests the node entity preview functionality.

Other projects


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