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
LanguageNegotiationUrl class Drupal\language\Plugin\LanguageNegotiation core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php Class for identifying language via URL prefix or domain. 17
LanguageNegotiationUrlFallback class Drupal\language\Plugin\LanguageNegotiation core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrlFallback.php Determines the language to be assigned to URLs when none is detected. 1
LanguageNegotiationUrlTest class Drupal\Tests\language\Unit core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php @coversDefaultClass \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl[[api-linebreak]] @group language
LanguageNegotiationUrlTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php @coversDefaultClass \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl[[api-linebreak]] @group language
LanguageNegotiationUser class Drupal\user\Plugin\LanguageNegotiation core/modules/user/src/Plugin/LanguageNegotiation/LanguageNegotiationUser.php Class for identifying language from the user preferences. 4
LanguageNegotiationUserAdmin class Drupal\user\Plugin\LanguageNegotiation core/modules/user/src/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php Identifies admin language from the user preferences. 2
LanguageNegotiator class Drupal\language core/modules/language/src/LanguageNegotiator.php Class responsible for performing language negotiation. 2
LanguageNegotiatorInterface interface Drupal\language core/modules/language/src/LanguageNegotiatorInterface.php Common interface for language negotiation services. 1 5
LanguageNegotiatorPluginTest class Drupal\Tests\language\Kernel core/modules/language/tests/src/Kernel/LanguageNegotiatorPluginTest.php Tests PluginNotFoundException.
LanguagePathMonolingualTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php Confirm that paths are not changed on monolingual non-English sites.
LanguagePluginTest class Drupal\Tests\ckeditor5\Unit core/modules/ckeditor5/tests/src/Unit/LanguagePluginTest.php @coversDefaultClass \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Language[[api-linebreak]] @group ckeditor5 @internal
LanguageReference class Drupal\Core\TypedData\Plugin\DataType core/lib/Drupal/Core/TypedData/Plugin/DataType/LanguageReference.php Defines the 'language_reference' data type. 1
LanguageRequestSubscriber class Drupal\language\EventSubscriber core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php Sets the $request property on the language manager.
LanguagesCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php Defines the LanguagesCacheContext service, for "per language" caching. 2
LanguageSelect class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/LanguageSelect.php Provides a form element for selecting a language.
LanguageSelectElementTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php Tests the language selection form element.
LanguageSelectorTranslatableTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php Tests the content translation settings language selector options.
LanguageSelectWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/LanguageSelectWidget.php Plugin implementation of the 'Language' widget.
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 3
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.
LanguageTestTrait trait Drupal\Tests\language\Traits core/modules/language/tests/src/Traits/LanguageTestTrait.php Provides an API to programmatically manage languages in tests. 8
LanguageTourTest class Drupal\Tests\tour\Functional\Language core/modules/tour/tests/src/Functional/Language/LanguageTourTest.php Tests tour functionality.
LanguageTypes 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 @coversDefaultClass \Drupal\language\Plugin\migrate\process\LanguageTypes[[api-linebreak]] @group language
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 @coversDefaultClass \Drupal\Core\Language\Language[[api-linebreak]] @group 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.
LastTimestamp class Drupal\comment\Plugin\views\field core/modules/comment/src/Plugin/views/field/LastTimestamp.php Field handler to display the timestamp of a comment with the count of comments.
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 @coversDefaultClass \Drupal\content_moderation\Access\LatestRevisionCheck[[api-linebreak]] @group content_moderation
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. 9
Layout class Drupal\Core\Layout\Annotation core/lib/Drupal/Core/Layout/Annotation/Layout.php Defines a Layout annotation object.
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.
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().

Other projects


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