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
LanguageSelectWidgetTest class Drupal\Tests\language\Kernel core/modules/language/tests/src/Kernel/LanguageSelectWidgetTest.php Tests the language select widget.
LanguageServiceProvider class Drupal\language core/modules/language/src/LanguageServiceProvider.php Overrides the language_manager service to point to language's module one.
LanguageSwitcherInterface interface Drupal\language core/modules/language/src/LanguageSwitcherInterface.php Interface for language switcher classes. 3 4
LanguageSwitchingTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageSwitchingTest.php Functional tests for the language switching feature.
LanguageTest class Drupal\Tests\language\Kernel\Plugin\migrate\source core/modules/language/tests/src/Kernel/Plugin/migrate/source/LanguageTest.php Tests the language source plugin.
LanguageTest class Drupal\Tests\ckeditor5\FunctionalJavascript core/modules/ckeditor5/tests/src/FunctionalJavascript/LanguageTest.php Tests for CKEditor 5 UI translations.
LanguageTest class Drupal\Tests\ckeditor5\Kernel core/modules/ckeditor5/tests/src/Kernel/LanguageTest.php Tests language resolving for CKEditor 5.
LanguageTestBase abstract class Drupal\Tests\language\Kernel\Views core/modules/language/tests/src/Kernel/Views/LanguageTestBase.php Defines the base class for all Language handler tests. 3
LanguageTestBase abstract class Drupal\Tests\language\Kernel core/modules/language/tests/src/Kernel/LanguageTestBase.php Test for dependency injected language object. 4
LanguageTestController class Drupal\language_test\Controller core/modules/language/tests/language_test/src/Controller/LanguageTestController.php Controller routines for language_test routes.
LanguageTestHooks class Drupal\language_test\Hook core/modules/language/tests/language_test/src/Hook/LanguageTestHooks.php Hook implementations for language_test.
LanguageTestTrait trait Drupal\Tests\language\Traits core/modules/language/tests/src/Traits/LanguageTestTrait.php Provides an API to programmatically manage languages in tests. 11
LanguageThemeHooks class Drupal\language\Hook core/modules/language/src/Hook/LanguageThemeHooks.php Hook implementations for language.
LanguageTypes

in drupal:11.3.0 and is removed from drupal:12.0.0. There is no replacement.

class Drupal\language\Plugin\migrate\process core/modules/language/src/Plugin/migrate/process/LanguageTypes.php Processes the array for the language types. 1
LanguageTypesTest class Drupal\Tests\language\Unit\process core/modules/language/tests/src/Unit/process/LanguageTypesTest.php Tests Drupal\language\Plugin\migrate\process\LanguageTypes.
LanguageUILanguageNegotiationTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php Tests the language UI for language switching.
LanguageUnitTest class Drupal\Tests\Core\Language core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php Tests Drupal\Core\Language\Language.
LanguageUrlRewritingTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php Tests that URL rewriting works as expected.
LargeQueryTest class Drupal\Tests\mysql\Kernel\mysql core/modules/mysql/tests/src/Kernel/mysql/LargeQueryTest.php Tests handling of large queries. 1 1
LargeQueryTest class Drupal\Tests\mysqli\Kernel\mysqli core/modules/mysqli/tests/src/Kernel/mysqli/LargeQueryTest.php Tests handling of large queries.
LastTimestamp class Drupal\comment\Plugin\views\field core/modules/comment/src/Plugin/views/field/LastTimestamp.php Displays the timestamp of a comment with the count of comments.
LateResourceTypeBuildEventSubscriber class Drupal\jsonapi_test_resource_type_building\EventSubscriber core/modules/jsonapi/tests/modules/jsonapi_test_resource_type_building/src/EventSubscriber/LateResourceTypeBuildEventSubscriber.php Event subscriber which tests enabling disabled resource type fields. 2
LatestRevision class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/LatestRevision.php Filter to show only the latest revision of an entity.
LatestRevisionCheck class Drupal\content_moderation\Access core/modules/content_moderation/src/Access/LatestRevisionCheck.php Access check for the entity moderation tab. 2 2
LatestRevisionCheckTest class Drupal\Tests\content_moderation\Unit core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php Tests Drupal\content_moderation\Access\LatestRevisionCheck.
LatestRevisionFilterTest class Drupal\Tests\views\Kernel\Entity core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php Tests the 'Latest revision' filter.
LatestTranslationAffectedRevision class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/LatestTranslationAffectedRevision.php Filter to show only the latest translation affected revision of an entity.
LatestTranslationAffectedRevisionTest class Drupal\Tests\views\Kernel\Entity core/modules/views/tests/src/Kernel/Entity/LatestTranslationAffectedRevisionTest.php Tests the 'Latest translation affected revision' filter.
Layout class Drupal\Core\Layout\Attribute core/lib/Drupal/Core/Layout/Attribute/Layout.php Defines a Layout attribute object. 8
Layout class Drupal\Core\Layout\Annotation core/lib/Drupal/Core/Layout/Annotation/Layout.php Defines a Layout annotation object.
LayoutAttributeTest class Drupal\Tests\Core\Layout core/tests/Drupal/Tests/Core/Layout/LayoutAttributeTest.php Tests the Layout attribute.
LayoutBuilder class Drupal\layout_builder\Element core/modules/layout_builder/src/Element/LayoutBuilder.php Defines a render element for building the Layout Builder UI.
LayoutBuilderAccessCheck class Drupal\layout_builder\Access core/modules/layout_builder/src/Access/LayoutBuilderAccessCheck.php Provides an access check for the Layout Builder defaults. 2
LayoutBuilderAccessTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php Tests access to Layout Builder.
LayoutBuilderBlockContentDependencyTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/LayoutBuilderBlockContentDependencyTest.php Test for installing Layout Builder before Block Content in the same request.
LayoutBuilderBlockContentDependencyTestThemeHooks class Drupal\layout_builder_block_content_dependency_test\Hook core/modules/layout_builder/tests/modules/layout_builder_block_content_dependency_test/src/Hook/LayoutBuilderBlockContentDependencyTestThemeHooks.php Hook implementations for layout_builder_block_content_dependency_test.
LayoutBuilderBlocksTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutBuilderBlocksTest.php Tests the Layout Builder UI with blocks.
LayoutBuilderBreadcrumbAlterTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/LayoutBuilderBreadcrumbAlterTest.php Tests layout_builder_system_breadcrumb_alter().
LayoutBuilderCompatibilityTestBase abstract class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/LayoutBuilderCompatibilityTestBase.php Tests Layout Builder's compatibility with existing systems. 2
LayoutBuilderContentModerationIntegrationTest class Drupal\Tests\content_moderation\Functional core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php Tests Content Moderation's integration with Layout Builder.
LayoutBuilderContextTrait trait Drupal\layout_builder\Context core/modules/layout_builder/src/Context/LayoutBuilderContextTrait.php Provides a wrapper around getting contexts from a section storage object. 6
LayoutBuilderController class Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/LayoutBuilderController.php Defines a controller to provide the Layout Builder admin UI.
LayoutBuilderDefaultValuesTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutBuilderDefaultValuesTest.php Tests rendering default field values in Layout Builder.
LayoutBuilderDisableForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/LayoutBuilderDisableForm.php Disables Layout Builder for a given default.
LayoutBuilderDisableInteractionsTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php Tests the Layout Builder disables interactions of rendered blocks.
LayoutBuilderEnabledInterface interface Drupal\layout_builder core/modules/layout_builder/src/LayoutBuilderEnabledInterface.php Provides methods for enabling and disabling Layout Builder. 2 2
LayoutBuilderEntityFormTrait trait Drupal\layout_builder\Form core/modules/layout_builder/src/Form/LayoutBuilderEntityFormTrait.php Provides a trait for common methods used in Layout Builder entity forms. 1
LayoutBuilderEntityViewDisplay class Drupal\layout_builder\Entity core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php Provides an entity view display entity that has a layout. 2 45
LayoutBuilderEntityViewDisplay class Drupal\layout_builder_override_dependency core/modules/layout_builder/tests/modules/layout_builder_override_dependency/src/LayoutBuilderEntityViewDisplay.php Provides an entity view display entity that has a layout. 2
LayoutBuilderEntityViewDisplay class Drupal\layout_builder_override core/modules/layout_builder/tests/modules/layout_builder_override/src/LayoutBuilderEntityViewDisplay.php Provides an entity view display entity that has a layout. 2

Other projects


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