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
LayoutBuilderNestedFormUiTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php Tests placing blocks containing forms in theLayout Builder UI.
LayoutBuilderOptInTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderOptInTest.php Tests the ability for opting in and out of Layout Builder.
LayoutBuilderOverridesPermissions class Drupal\layout_builder core/modules/layout_builder/src/LayoutBuilderOverridesPermissions.php Provides dynamic permissions for Layout Builder overrides.
LayoutBuilderPermissionsUpdatePathTest class Drupal\Tests\layout_builder\Functional\Update core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderPermissionsUpdatePathTest.php Tests the upgrade path for Layout Builder permissions.
LayoutBuilderQuickEditTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php Tests that Layout Builder functions with Quick Edit.
LayoutBuilderQuickEditTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutBuilderQuickEditTest.php Tests Layout Builder integration with Quick Edit.
LayoutBuilderRoutes class Drupal\layout_builder\Routing core/modules/layout_builder/src/Routing/LayoutBuilderRoutes.php Provides routes for the Layout Builder UI. 1 2
LayoutBuilderRoutesTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/LayoutBuilderRoutesTest.php @coversDefaultClass \Drupal\layout_builder\Routing\LayoutBuilderRoutes
LayoutBuilderRoutesTrait trait Drupal\layout_builder\Routing core/modules/layout_builder/src/Routing/LayoutBuilderRoutesTrait.php Provides a trait for building routes for a Layout Builder UI. 2
LayoutBuilderSampleEntityGenerator class Drupal\layout_builder\Entity core/modules/layout_builder/src/Entity/LayoutBuilderSampleEntityGenerator.php Generates a sample entity for use by the Layout Builder. 2
LayoutBuilderSectionStorageTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php Tests the UI aspects of section storage.
LayoutBuilderServiceProvider class Drupal\layout_builder core/modules/layout_builder/src/LayoutBuilderServiceProvider.php Sets the layout_builder.get_block_dependency_subscriber service definition.
LayoutBuilderSortTrait trait Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderSortTrait.php LayoutBuilderSortTrait, provides callback for simulated layout change.
LayoutBuilderTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php Tests the Layout Builder UI.
LayoutBuilderTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php Tests the Layout Builder UI.
LayoutBuilderTestPlugin class Drupal\layout_builder_test\Plugin\Layout core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Layout/LayoutBuilderTestPlugin.php Plugin annotation @Layout( id = "layout_builder_test_plugin", label = @Translation("Layout Builder Test Plugin"), regions = { "main" = { "label" = @Translation("Main Region") } }, )
LayoutBuilderThemeSuggestionsTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutBuilderThemeSuggestionsTest.php Tests template suggestions.
LayoutBuilderToolbarTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderToolbarTest.php Test Layout Builder integration with Toolbar.
LayoutBuilderTranslationTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php Tests that the Layout Builder works with translated content.
LayoutBuilderUiCacheContext class Drupal\layout_builder\Cache core/modules/layout_builder/src/Cache/LayoutBuilderUiCacheContext.php Determines if an entity is being viewed in the Layout Builder UI. 2
LayoutBuilderUiTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php Tests the Layout Builder UI.
LayoutBuilderWidget class Drupal\layout_builder\Plugin\Field\FieldWidget core/modules/layout_builder/src/Plugin/Field/FieldWidget/LayoutBuilderWidget.php A widget to display the layout form.
LayoutDefault class Drupal\Core\Layout core/lib/Drupal/Core/Layout/LayoutDefault.php Provides a default class for Layout plugins. 7 11
LayoutDefaultTest class Drupal\Tests\Core\Layout core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php @coversDefaultClass \Drupal\Core\Layout\LayoutDefault @group Layout
LayoutDefinition class Drupal\Core\Layout core/lib/Drupal/Core/Layout/LayoutDefinition.php Provides an implementation of a layout definition and its metadata. 5
LayoutDeriver class Drupal\Tests\Core\Layout core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php Provides a dynamic layout deriver for the test.
LayoutDiscoveryDependenciesUpdateTest class Drupal\Tests\layout_discovery\Functional\Update core/modules/layout_discovery/tests/src/Functional/Update/LayoutDiscoveryDependenciesUpdateTest.php Tests the upgrade path for updating the layout discovery dependencies.
LayoutDisplayTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php Tests functionality of the entity view display with regard to Layout Builder.
LayoutEntityDisplayInterface interface Drupal\layout_builder\Entity core/modules/layout_builder/src/Entity/LayoutEntityDisplayInterface.php Provides an interface for entity displays that have layout. 1 6
LayoutEntityDisplayNormalizer class Drupal\layout_builder\Normalizer core/modules/layout_builder/src/Normalizer/LayoutEntityDisplayNormalizer.php Normalizes/denormalizes LayoutEntityDisplay objects into an array structure. 1
LayoutEntityHelperTrait trait Drupal\layout_builder core/modules/layout_builder/src/LayoutEntityHelperTrait.php Methods to help with entities using the layout builder. 4
LayoutEntityHelperTraitTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/LayoutEntityHelperTraitTest.php @coversDefaultClass \Drupal\layout_builder\LayoutEntityHelperTrait
LayoutEntityHelperTraitTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/LayoutEntityHelperTraitTest.php @coversDefaultClass \Drupal\layout_builder\LayoutEntityHelperTrait
LayoutFieldTranslateUpdateConfig class Drupal\Tests\layout_builder\Functional\Update\Translatability core/modules/layout_builder/tests/src/Functional/Update/Translatability/LayoutFieldTranslateUpdateConfig.php A test case that updates 1 bundle's field but not both.
LayoutFieldTranslateUpdateConfigAndStorage class Drupal\Tests\layout_builder\Functional\Update\Translatability core/modules/layout_builder/tests/src/Functional/Update/Translatability/LayoutFieldTranslateUpdateConfigAndStorage.php A test case that updates both bundles' fields.
LayoutInterface interface Drupal\Core\Layout core/lib/Drupal/Core/Layout/LayoutInterface.php Provides an interface for static Layout plugins. 1 5
LayoutPluginManager class Drupal\Core\Layout core/lib/Drupal/Core/Layout/LayoutPluginManager.php Provides a plugin manager for layouts. 1 2
LayoutPluginManagerInterface interface Drupal\Core\Layout core/lib/Drupal/Core/Layout/LayoutPluginManagerInterface.php Provides the interface for a plugin manager of layouts. 1 7
LayoutPluginManagerTest class Drupal\Tests\Core\Layout core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php @coversDefaultClass \Drupal\Core\Layout\LayoutPluginManager @group Layout
LayoutPreviewAccessAllowed class Drupal\layout_builder\Access core/modules/layout_builder/src/Access/LayoutPreviewAccessAllowed.php Accessible class to allow access for inline blocks in the Layout Builder. 2
LayoutRebuildConfirmFormBase abstract class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/LayoutRebuildConfirmFormBase.php Provides a base class for confirmation forms that rebuild the Layout Builder. 2
LayoutRebuildTrait trait Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php Provides AJAX responses to rebuild the Layout Builder. 4
LayoutRestTestBase abstract class Drupal\Tests\layout_builder\Functional\Rest core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php Base class for Layout Builder REST tests. 1
LayoutSectionAccessCheck class Drupal\layout_builder\Access core/modules/layout_builder/src/Access/LayoutSectionAccessCheck.php Provides an access check for the Layout Builder UI. 2
LayoutSectionItem class Drupal\layout_builder\Plugin\Field\FieldType core/modules/layout_builder/src/Plugin/Field/FieldType/LayoutSectionItem.php Plugin implementation of the 'layout_section' field type.
LayoutSectionItemList class Drupal\layout_builder\Field core/modules/layout_builder/src/Field/LayoutSectionItemList.php Defines a item list class for layout section fields.
LayoutSectionItemListTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/LayoutSectionItemListTest.php Tests the field type for Layout Sections.
LayoutSectionTest class Drupal\Tests\layout_builder\Functional core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php Tests the rendering of a layout section field.
LayoutTempstoreParamConverter class Drupal\layout_builder\Routing core/modules/layout_builder/src/Routing/LayoutTempstoreParamConverter.php Loads the section storage from the layout tempstore. 1 2
LayoutTempstoreParamConverterTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/LayoutTempstoreParamConverterTest.php @coversDefaultClass \Drupal\layout_builder\Routing\LayoutTempstoreParamConverter

Other projects


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