Classes, traits, and interfaces - 9.5.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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
LanguageInterface interface Drupal\Core\Language core/lib/Drupal/Core/Language/LanguageInterface.php Defines an interface for languages. 2 224
LanguageItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php Defines the 'language' entity field item. 1 1
LanguageListBuilder class Drupal\language core/modules/language/src/LanguageListBuilder.php Defines a class to build a listing of language entities.
LanguageListModuleInstallTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php Tests that the language list is not empty when language is installed.
LanguageListTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageListTest.php Adds a new language and tests changing its status and the default language.
LanguageLocaleListTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageLocaleListTest.php Adds a new language with translations and tests language list order.
LanguageLocalTasksTest class Drupal\Tests\language\Unit\Menu core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php Tests existence of language local tasks.
LanguageManager class Drupal\Core\Language core/lib/Drupal/Core/Language/LanguageManager.php Class responsible for providing language support on language-unaware sites. 1 13 2
LanguageManagerInterface interface Drupal\Core\Language core/lib/Drupal/Core/Language/LanguageManagerInterface.php Common interface for the language manager service. 2 95
LanguageNegotiation class Drupal\language\Annotation core/modules/language/src/Annotation/LanguageNegotiation.php Defines a language negotiation annotation object.
LanguageNegotiation class Drupal\language\Plugin\migrate\process core/modules/language/src/Plugin/migrate/process/LanguageNegotiation.php Processes the arrays for the language types' negotiation methods and weights. 1
LanguageNegotiationBrowser class Drupal\language\Plugin\LanguageNegotiation core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationBrowser.php Class for identifying language from the browser Accept-language HTTP header. 1
LanguageNegotiationContentEntity class Drupal\language\Plugin\LanguageNegotiation core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php Class for identifying the content translation language. 2
LanguageNegotiationContentEntityTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php Tests language negotiation with the language negotiator content entity.
LanguageNegotiationFormOverrideTest class Drupal\Tests\config\Functional core/modules/config/tests/src/Functional/LanguageNegotiationFormOverrideTest.php Tests language-negotiation overrides are not on language-negotiation form.
LanguageNegotiationInfoTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php Tests alterations to language types/negotiation info.
LanguageNegotiationMethodBase abstract class Drupal\language core/modules/language/src/LanguageNegotiationMethodBase.php Base class for language negotiation methods. 10 10
LanguageNegotiationMethodInterface interface Drupal\language core/modules/language/src/LanguageNegotiationMethodInterface.php Interface for language negotiation classes. 1
LanguageNegotiationMethodManager class Drupal\language core/modules/language/src/LanguageNegotiationMethodManager.php Manages language negotiation methods. 2
LanguageNegotiationSelected class Drupal\language\Plugin\LanguageNegotiation core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSelected.php Class for identifying language from a selected language. 2
LanguageNegotiationSession class Drupal\language\Plugin\LanguageNegotiation core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationSession.php Identify language from a request/session parameter. 1
LanguageNegotiationSessionTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/LanguageNegotiationSessionTest.php Tests the session language negotiation method.
LanguageNegotiationTest class Drupal\Tests\language\Unit\process core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php @coversDefaultClass \Drupal\language\Plugin\migrate\process\LanguageNegotiation[[api-linebreak]] @group language
LanguageNegotiationTest class Drupal\language_test\Plugin\LanguageNegotiation core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTest.php Class for identifying language from a selected language. 1
LanguageNegotiationTestTs class Drupal\language_test\Plugin\LanguageNegotiation core/modules/language/tests/language_test/src/Plugin/LanguageNegotiation/LanguageNegotiationTestTs.php Class for identifying language from a selected language.
LanguageNegotiationUI class Drupal\language\Plugin\LanguageNegotiation core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUI.php Identifies the language from the interface text language selected for page. 4
LanguageNegotiationUrl class Drupal\language\Plugin\LanguageNegotiation core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php Class for identifying language via URL prefix or domain. 14
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. 3
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.
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.

Other projects


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