Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
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. 1
BrowserTestBase abstract class Drupal\Tests core/tests/Drupal/Tests/BrowserTestBase.php Provides a test case for functional Drupal tests. 620 627
BrowserTestBaseMockableClassTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php A class extending BrowserTestBase for testing purposes.
BrowserTestBaseTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php Tests Drupal\Tests\BrowserTestBase.
BrowserTestBaseTest class Drupal\FunctionalTests core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php Tests BrowserTestBase functionality.
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 70
BubbleableMetadataTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php Tests Drupal\Core\Render\BubbleableMetadata.
BubblingTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php Test class with implemented trusted callbacks.
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.
BuildTest final class Drupal\Tests\Component\Foo core/tests/PHPStan/fixtures/component-tests.php
BuildTestBase abstract class Drupal\BuildTests\Framework core/tests/Drupal/BuildTests/Framework/BuildTestBase.php Provides a workspace to test build processes. 11 13
BuildTestTest class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php Tests Drupal\BuildTests\Framework\BuildTestBase.
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\user\Functional\Views core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php Tests if entity access is respected on a user bulk form.
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.
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 Tests Drupal\views\Plugin\views\field\BulkForm.
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\user\Functional\Views core/modules/user/tests/src/Functional/Views/BulkFormTest.php Tests a user bulk form.
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.
Bundle class Drupal\Core\Entity\Attribute core/lib/Drupal/Core/Entity/Attribute/Bundle.php Defines an attribute for registering a bundle class. 4
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
BundleClassTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/BundleClassTest.php Tests entity bundle classes.
BundleConfigImportValidate class Drupal\Core\Entity\Event core/lib/Drupal/Core/Entity/Event/BundleConfigImportValidate.php Entity config importer validation event subscriber. 2
BundleConstraint class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/BundleConstraint.php Checks if a value is a valid entity type. 1
BundleConstraintValidator class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/BundleConstraintValidator.php Validates the Bundle constraint.
BundleConstraintValidatorTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php Tests validation constraints for BundleConstraintValidator.
BundleEntityFormBase class Drupal\Core\Entity core/lib/Drupal/Core/Entity/BundleEntityFormBase.php Class BundleEntityFormBase is a base form for bundle config entities. 4 8
BundleEntityStorageInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/BundleEntityStorageInterface.php A storage that supports entities with bundle specific classes. 1
BundlePermissionHandlerTrait trait Drupal\Core\Entity core/lib/Drupal/Core/Entity/BundlePermissionHandlerTrait.php Provides a method to simplify generating bundle level permissions. 5
BundlePermissionHandlerTraitTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/BundlePermissionHandlerTraitTest.php Tests Drupal\Core\Entity\BundlePermissionHandlerTrait.
BundleTranslationSettingsInterface interface Drupal\content_translation core/modules/content_translation/src/BundleTranslationSettingsInterface.php Interface providing support for content translation bundle settings. 1 2
Button class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Button.php Provides an action button form element. 1
Bytes class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Bytes.php Provides helper methods for byte conversions. 12 1
ByteSizeMarkup final class Drupal\Core\StringTranslation core/lib/Drupal/Core/StringTranslation/ByteSizeMarkup.php A class to generate translatable markup for the given byte count. 18
ByteSizeMarkupTest class Drupal\Tests\Core\StringTranslation core/tests/Drupal/Tests/Core/StringTranslation/ByteSizeMarkupTest.php Tests Drupal\Core\StringTranslation\ByteSizeMarkup.
BytesTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/BytesTest.php Tests bytes size parsing helper methods.
Cache class Drupal\Core\Cache core/lib/Drupal/Core/Cache/Cache.php Helper methods for cache. 228
CacheabilityMetadataConfigOverride class Drupal\config_override_integration_test core/modules/config/tests/config_override_integration_test/src/CacheabilityMetadataConfigOverride.php Test implementation of a config override that provides cacheability metadata. 2
CacheabilityMetadataConfigOverrideIntegrationTest class Drupal\Tests\config\Functional core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php Tests if configuration overrides correctly affect cacheability metadata.
CacheabilityMetadataConfigOverrideTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/CacheabilityMetadataConfigOverrideTest.php Tests if configuration overrides correctly affect cacheability metadata.
CacheableAccessDeniedHttpException class Drupal\Core\Http\Exception core/lib/Drupal/Core/Http/Exception/CacheableAccessDeniedHttpException.php A cacheable AccessDeniedHttpException. 1 5

Other projects


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