Classes, traits, and interfaces - 8.9.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 1511

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
LanguageTourTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/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 @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 @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\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/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 @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\Annotation core/lib/Drupal/Core/Layout/Annotation/Layout.php Defines a Layout annotation object. 1
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.
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. 3 1
LayoutBuilderContentModerationIntegrationTest class Drupal\Tests\content_moderation\Functional core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php Tests Content Moderation's integration with Layout Builder.
LayoutBuilderContextMappingUpdatePathTest class Drupal\Tests\layout_builder\Functional\Update core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderContextMappingUpdatePathTest.php Tests context-aware blocks after the context changes to section storage.
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. 3
LayoutBuilderController class Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/LayoutBuilderController.php Defines a controller to provide the Layout Builder admin UI.
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 1
LayoutBuilderEnableUpdatePathTest class Drupal\Tests\layout_builder\Functional\Update core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderEnableUpdatePathTest.php Tests the upgrade path for enabling Layout Builder.
LayoutBuilderEntityViewDisplay class Drupal\layout_builder\Entity core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php Provides an entity view display entity that has a layout. 14
LayoutBuilderEntityViewDisplayForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php Edit form for the LayoutBuilderEntityViewDisplay entity type. 1
LayoutBuilderEntityViewDisplayHalJsonAnonTest class Drupal\Tests\layout_builder\Functional\Hal core/modules/layout_builder/tests/src/Functional/Hal/LayoutBuilderEntityViewDisplayHalJsonAnonTest.php @group layout_builder @group rest 1
LayoutBuilderEntityViewDisplayHalJsonBasicAuthTest class Drupal\Tests\layout_builder\Functional\Hal core/modules/layout_builder/tests/src/Functional/Hal/LayoutBuilderEntityViewDisplayHalJsonBasicAuthTest.php @group layout_builder @group rest
LayoutBuilderEntityViewDisplayHalJsonCookieTest class Drupal\Tests\layout_builder\Functional\Hal core/modules/layout_builder/tests/src/Functional/Hal/LayoutBuilderEntityViewDisplayHalJsonCookieTest.php @group layout_builder @group rest
LayoutBuilderEntityViewDisplayJsonAnonTest class Drupal\Tests\layout_builder\Functional\Rest core/modules/layout_builder/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonAnonTest.php @group layout_builder @group rest
LayoutBuilderEntityViewDisplayJsonBasicAuthTest class Drupal\Tests\layout_builder\Functional\Rest core/modules/layout_builder/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php @group layout_builder @group rest
LayoutBuilderEntityViewDisplayJsonCookieTest class Drupal\Tests\layout_builder\Functional\Rest core/modules/layout_builder/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonCookieTest.php @group layout_builder @group rest
LayoutBuilderEntityViewDisplayResourceTestBase abstract class Drupal\Tests\layout_builder\Functional\Rest core/modules/layout_builder/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayResourceTestBase.php Provides a base class for testing LayoutBuilderEntityViewDisplay resources. 7 1
LayoutBuilderEntityViewDisplayStorage class Drupal\layout_builder\Entity core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplayStorage.php Provides storage for entity view display entities that have layouts. 1
LayoutBuilderEntityViewDisplayTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php @coversDefaultClass \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay
LayoutBuilderEntityViewDisplayTest class Drupal\Tests\layout_builder\Functional\Jsonapi core/modules/layout_builder/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php JSON:API integration test for the "EntityViewDisplay" config entity type.
LayoutBuilderEntityViewDisplayXmlAnonTest class Drupal\Tests\layout_builder\Functional\Rest core/modules/layout_builder/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlAnonTest.php @group layout_builder @group rest
LayoutBuilderEntityViewDisplayXmlBasicAuthTest class Drupal\Tests\layout_builder\Functional\Rest core/modules/layout_builder/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php @group layout_builder @group rest
LayoutBuilderEntityViewDisplayXmlCookieTest class Drupal\Tests\layout_builder\Functional\Rest core/modules/layout_builder/tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlCookieTest.php @group layout_builder @group rest
LayoutBuilderEvents final class Drupal\layout_builder core/modules/layout_builder/src/LayoutBuilderEvents.php Defines events for the layout_builder module. 2
LayoutBuilderFieldBlockEntityReferenceCacheTagsTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php Tests cache tags on entity reference field blocks in Layout Builder.
LayoutBuilderFieldLayoutCompatibilityTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/LayoutBuilderFieldLayoutCompatibilityTest.php Ensures that Layout Builder and Field Layout are compatible with each other.
LayoutBuilderHighlightTrait trait Drupal\layout_builder core/modules/layout_builder/src/LayoutBuilderHighlightTrait.php A trait for generating IDs used to highlight active UI elements. 8
LayoutBuilderHtmlEntityFormController class Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php Overrides the entity form controller service for layout builder operations. 2
LayoutBuilderInstallTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/LayoutBuilderInstallTest.php Ensures that Layout Builder and core EntityViewDisplays are compatible.
LayoutBuilderIsActiveCacheContext class Drupal\layout_builder\Cache core/modules/layout_builder/src/Cache/LayoutBuilderIsActiveCacheContext.php Determines whether Layout Builder is active for a given entity type or not. 2
LayoutBuilderLocalTaskDeriver class Drupal\layout_builder\Plugin\Derivative core/modules/layout_builder/src/Plugin/Derivative/LayoutBuilderLocalTaskDeriver.php Provides local task definitions for the layout builder user interface. 1

Other projects


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