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
BooleanOperatorString class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/BooleanOperatorString.php Simple filter to handle matching of boolean values.
BootstrapConfigStorageFactory class Drupal\Core\Config core/lib/Drupal/Core/Config/BootstrapConfigStorageFactory.php Defines a factory for retrieving the config storage used pre-kernel. 4
Box class Drupal\block_content\Plugin\migrate\source\d6 core/modules/block_content/src/Plugin/migrate/source/d6/Box.php Drupal 6 block source from database.
BoxTest class Drupal\Tests\block_content\Kernel\Plugin\migrate\source\d6 core/modules/block_content/tests/src/Kernel/Plugin/migrate/source/d6/BoxTest.php Tests D6 block boxes source plugin.
BoxTranslation class Drupal\block_content\Plugin\migrate\source\d6 core/modules/block_content/src/Plugin/migrate/source/d6/BoxTranslation.php Gets Drupal 6 i18n custom block translations from database.
BoxTranslationTest class Drupal\Tests\block_content\Kernel\Plugin\migrate\source\d6 core/modules/block_content/tests/src/Kernel/Plugin/migrate/source/d6/BoxTranslationTest.php Tests i18n custom block translations source plugin.
Breadcrumb class Drupal\Core\Breadcrumb core/lib/Drupal/Core/Breadcrumb/Breadcrumb.php Used to return generated breadcrumbs with associated cacheability metadata. 10
Breadcrumb404Test class Drupal\FunctionalTests\Breadcrumb core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php Tests the breadcrumb of 404 pages.
BreadcrumbBuilderInterface interface Drupal\Core\Breadcrumb core/lib/Drupal/Core/Breadcrumb/BreadcrumbBuilderInterface.php Defines an interface for classes that build breadcrumbs. 7 7
BreadcrumbFrontCacheContextsTest class Drupal\Tests\system\Functional\Menu core/modules/system/tests/src/Functional/Menu/BreadcrumbFrontCacheContextsTest.php Tests breadcrumbs functionality.
BreadcrumbManager class Drupal\Core\Breadcrumb core/lib/Drupal/Core/Breadcrumb/BreadcrumbManager.php Provides a breadcrumb manager. 1 2
BreadcrumbManagerTest class Drupal\Tests\Core\Breadcrumb core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php @coversDefaultClass \Drupal\Core\Breadcrumb\BreadcrumbManager @group Breadcrumb
BreadcrumbTest class Drupal\Tests\Core\Breadcrumb core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php @coversDefaultClass \Drupal\Core\Breadcrumb\Breadcrumb @group Breadcrumb
BreadcrumbTest class Drupal\Tests\system\Functional\Menu core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php Tests breadcrumbs functionality.
BreakLockForm class Drupal\views_ui\Form core/modules/views_ui/src/Form/BreakLockForm.php Builds the form to break the lock of an edited view.
BreakLockLink class Drupal\Core\TempStore\Element core/lib/Drupal/Core/TempStore/Element/BreakLockLink.php Provides a link to break a tempstore lock.
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. 1
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
BrokenSetUpTest class Drupal\simpletest\Tests core/modules/simpletest/src/Tests/BrokenSetUpTest.php Tests a test case that does not call parent::setUp().
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 class Drupal\FunctionalTests core/tests/fixtures/BrowserMissingDependentModuleMethodTest.php A fixture test class with requires annotation. 1
BrowserMissingDependentModuleTest class Drupal\FunctionalTests core/tests/fixtures/BrowserMissingDependentModuleTest.php A fixture test class with requires annotation. 1
BrowserTest class Drupal\simpletest\Tests core/modules/simpletest/src/Tests/BrowserTest.php Tests the internal browser of the testing framework.
BrowserTestBase

in drupal:8.1.0 and is removed from drupal:9.0.0. Use Drupal\Tests\BrowserTestBase instead.

abstract class Drupal\simpletest core/modules/simpletest/src/BrowserTestBase.php Provides a test case for functional Drupal tests.
BrowserTestBase abstract class Drupal\Tests core/tests/Drupal/Tests/BrowserTestBase.php Provides a test case for functional Drupal tests. 554 559
BrowserTestBaseLegacyTest class Drupal\FunctionalTests core/tests/Drupal/FunctionalTests/BrowserTestBaseLegacyTest.php Tests BrowserTestBase legacy functionality.
BrowserTestBaseTest class Drupal\FunctionalTests core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php Tests BrowserTestBase functionality.
BrowserTestBaseTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php @coversDefaultClass \Drupal\Tests\BrowserTestBase @group Test
BrowserTestBaseTest class Drupal\KernelTests\Core\Test core/tests/Drupal/KernelTests/Core/Test/BrowserTestBaseTest.php @group Test @group FunctionalTests
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 68

Other projects


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