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
Breakpoint class Drupal\breakpoint core/modules/breakpoint/src/Breakpoint.php Default object used for breakpoint plugins. 1
BreakpointDiscoveryTest class Drupal\Tests\breakpoint\Kernel core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php Tests discovery of breakpoints provided by themes and modules.
BreakpointInterface interface Drupal\breakpoint core/modules/breakpoint/src/BreakpointInterface.php Interface for Breakpoint plugins. 1 1
BreakpointManager class Drupal\breakpoint core/modules/breakpoint/src/BreakpointManager.php Defines a breakpoint plugin manager to deal with breakpoints. 2
BreakpointManagerInterface interface Drupal\breakpoint core/modules/breakpoint/src/BreakpointManagerInterface.php Defines an interface for breakpoint managers. 1 1
BreakpointTest class Drupal\Tests\breakpoint\Unit core/modules/breakpoint/tests/src/Unit/BreakpointTest.php @coversDefaultClass \Drupal\breakpoint\Breakpoint @group Breakpoint
Broccoli class Drupal\Tests\Component\Plugin\Fixtures\vegetable core/tests/Drupal/Tests/Component/Plugin/Fixtures/vegetable/Broccoli.php Plugin annotation @Plugin( id = "broccoli", label = "Broccoli", color = "green" ) 1
Broken class Drupal\Core\Entity\Plugin\EntityReferenceSelection core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/Broken.php Defines a fallback plugin for missing entity_reference selection plugins.
Broken class Drupal\Core\Block\Plugin\Block core/lib/Drupal/Core/Block/Plugin/Block/Broken.php Defines a fallback plugin for missing block plugins. 2
Broken class Drupal\views\Plugin\views\sort core/modules/views/src/Plugin/views/sort/Broken.php A special handler to take the place of missing or broken handlers.
Broken class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/Broken.php A special handler to take the place of missing or broken handlers. 1
Broken class Drupal\views\Plugin\views\relationship core/modules/views/src/Plugin/views/relationship/Broken.php A special handler to take the place of missing or broken handlers.
Broken class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/Broken.php A special handler to take the place of missing or broken handlers. 2
Broken class Drupal\views\Plugin\views\area core/modules/views/src/Plugin/views/area/Broken.php A special handler to take the place of missing or broken handlers. 1
Broken class Drupal\views\Plugin\views\argument core/modules/views/src/Plugin/views/argument/Broken.php A special handler to take the place of missing or broken handlers.
BrokenCacheUpdateTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/BrokenCacheUpdateTest.php Ensures that a broken or out-of-date element info cache is not used.
BrokenHandlerTrait trait Drupal\views\Plugin\views core/modules/views/src/Plugin/views/BrokenHandlerTrait.php A Trait for Views broken handlers. 6
BrokenInboundPathProcessor class Drupal\update_script_test\PathProcessor core/modules/system/tests/modules/update_script_test/src/PathProcessor/BrokenInboundPathProcessor.php Example path processor which breaks on inbound. 2
BrokenPostRequestException class Drupal\Core\Form\Exception core/lib/Drupal/Core/Form/Exception/BrokenPostRequestException.php Defines an exception used, when the POST HTTP body is broken. 4
BrokenSystemTestController class Drupal\system_test\Controller core/modules/system/tests/modules/system_test/src/Controller/BrokenSystemTestController.php A controller that does not specify its autowired dependencies correctly. 1
BrokenToolkit class Drupal\image_test\Plugin\ImageToolkit core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/BrokenToolkit.php Defines a Test toolkit for image manipulation within Drupal.
BrowserHtmlDebugTrait trait Drupal\Tests core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php Provides the debug functions for browser tests.
BrowserMissingDependentModuleMethodTest

in drupal:10.3.0 and is removed from drupal:11.0.0. There is no replacement.

class Drupal\FunctionalTests core/tests/fixtures/BrowserMissingDependentModuleMethodTest.php A fixture test class with requires annotation. 1
BrowserMissingDependentModuleTest

in drupal:10.3.0 and is removed from drupal:11.0.0. There is no replacement.

class Drupal\FunctionalTests core/tests/fixtures/BrowserMissingDependentModuleTest.php A fixture test class with requires annotation. 1
BrowserTestBase abstract class Drupal\Tests core/tests/Drupal/Tests/BrowserTestBase.php Provides a test case for functional Drupal tests. 598 605
BrowserTestBaseMockableClass class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php A class extending BrowserTestBase for testing purposes.
BrowserTestBaseTest class Drupal\FunctionalTests core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php Tests BrowserTestBase functionality.
BrowserTestBaseTest class Drupal\KernelTests\Core\Test core/tests/Drupal/KernelTests/Core/Test/BrowserTestBaseTest.php @group Test @group FunctionalTests @group legacy
BrowserTestBaseTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php @coversDefaultClass \Drupal\Tests\BrowserTestBase @group Test
BrowserTestBaseUserAgentTest class Drupal\FunctionalTests core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php Tests BrowserTestBase functionality.
BrowserWithJavascriptTest class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php Tests if we can execute JavaScript in the browser.
BubbleableMetadata class Drupal\Core\Render core/lib/Drupal/Core/Render/BubbleableMetadata.php Value object used for bubbleable rendering metadata. 3 71
BubbleableMetadataTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php @coversDefaultClass \Drupal\Core\Render\BubbleableMetadata @group Render
BubblingTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
BuilderInterface interface Drupal\Composer\Generator composer/Generator/BuilderInterface.php Produce the output for a metapackage. 1 1
BuilderTest class Drupal\Tests\Composer\Generator core/tests/Drupal/Tests/Composer/Generator/BuilderTest.php Test DrupalCoreRecommendedBuilder.
BuildTestBase abstract class Drupal\BuildTests\Framework core/tests/Drupal/BuildTests/Framework/BuildTestBase.php Provides a workspace to test build processes. 6 6
BuildTestSuite

in drupal:10.3.0 and is removed from drupal:11.0.0. There is no replacement and test discovery will be handled differently in PHPUnit 10.

class Drupal\Tests\TestSuites core/tests/TestSuites/BuildTestSuite.php Discovers tests for the build test suite.
BuildTestTest class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php @coversDefaultClass \Drupal\BuildTests\Framework\BuildTestBase @group Build
BulkDeleteTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/BulkDeleteTest.php Bulk delete storages and fields, and clean up afterwards.
BulkForm class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/BulkForm.php Defines an actions-based bulk operation form element. 3 4
BulkFormAccessTest class Drupal\Tests\node\Functional\Views core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php Tests if entity access is respected on a node bulk operations form.
BulkFormAccessTest class Drupal\Tests\user\Functional\Views core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php Tests if entity access is respected on a user bulk form.
BulkFormTest class Drupal\Tests\user\Functional\Views core/modules/user/tests/src/Functional/Views/BulkFormTest.php Tests a user bulk form.
BulkFormTest class Drupal\Tests\views\Functional core/modules/views/tests/src/Functional/BulkFormTest.php Tests the views bulk form test. 1 1
BulkFormTest class Drupal\Tests\node\Functional\Views core/modules/node/tests/src/Functional/Views/BulkFormTest.php Tests a node bulk form.
BulkFormTest class Drupal\Tests\views\Unit\Plugin\views\field core/modules/views/tests/src/Unit/Plugin/views/field/BulkFormTest.php @coversDefaultClass \Drupal\views\Plugin\views\field\BulkForm @group Views
BulkOperationsTest class Drupal\Tests\views\FunctionalJavascript\Plugin core/modules/views/tests/src/FunctionalJavascript/Plugin/BulkOperationsTest.php Tests the bulk operations.
Bundle class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/Bundle.php Filter class which allows filtering by entity bundles.
BundleClassInheritanceException class Drupal\Core\Entity\Exception core/lib/Drupal/Core/Entity/Exception/BundleClassInheritanceException.php Exception thrown if a bundle class does not extend the main entity class. 2

Other projects


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