Classes, traits, and interfaces in Drupal 9
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
|
Name |
Type | Namespace | Location | Description | Direct uses | Use statements | Strings |
|---|---|---|---|---|---|---|---|
| BlockJsonAnonTest | class |
Drupal\ |
core/ |
@group rest | |||
| BlockJsonBasicAuthTest | class |
Drupal\ |
core/ |
@group rest | |||
| BlockJsonCookieTest | class |
Drupal\ |
core/ |
@group rest | |||
| BlockLanguageCacheTest | class |
Drupal\ |
core/ |
Tests display of menu blocks with multiple languages. | |||
| BlockLanguageTest | class |
Drupal\ |
core/ |
Tests if a block can be configured to be only visible on a particular language. | |||
| BlockLayoutTourTest | class |
Drupal\ |
core/ |
Tests the Block Layout tour. | |||
| BlockLibraryController | class |
Drupal\ |
core/ |
Provides a list of block plugins to be added to the layout. | |||
| BlockListBuilder | class |
Drupal\ |
core/ |
Defines a class to build a listing of block entities. | |||
| BlockListController | class |
Drupal\ |
core/ |
Defines a controller to list blocks. | |||
| BlockLocalTasksTest | class |
Drupal\ |
core/ |
Tests block local tasks. | |||
| BlockManager | class |
Drupal\ |
core/ |
Manages discovery and instantiation of block plugins. | 1 | 2 | |
| BlockManagerInterface | interface |
Drupal\ |
core/ |
Provides an interface for the discovery and instantiation of block plugins. | 1 | 10 | |
| BlockManagerTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Block\BlockManager | |||
| BlockNodeTypeVisibilityUpdateTest | class |
Drupal\ |
core/ |
Tests the upgrade path for updating the node type visibility condition. | |||
| BlockPageDisplayVariantSubscriber | class |
Drupal\ |
core/ |
Selects the block page display variant. | 2 | ||
| BlockPageVariant | class |
Drupal\ |
core/ |
Provides a page display variant that decorates the main content with blocks. | |||
| BlockPageVariantTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\block\Plugin\DisplayVariant\BlockPageVariant @group block | |||
| BlockPluginCollection | class |
Drupal\ |
core/ |
Provides a collection of block plugins. | 1 | ||
| BlockPluginHasSettingsTrayFormAccessCheck | class |
Drupal\ |
core/ |
Determines whether the requested block has a 'settings_tray' form. | 1 | 2 | |
| BlockPluginHasSettingsTrayFormAccessCheckTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\settings_tray\Access\BlockPluginHasSettingsTrayFormAccessCheck @group settings_tray | |||
| BlockPluginId | class |
Drupal\ |
core/ |
Plugin annotation @MigrateProcessPlugin( id = "block_plugin_id" ) | |||
| BlockPluginInterface | interface |
Drupal\ |
core/ |
Defines the required interface for all block plugins. | 7 | 20 | |
| BlockPluginTrait | trait |
Drupal\ |
core/ |
Provides the base implementation of a block plugin. | 1 | ||
| BlockRebuildTest | class |
Drupal\ |
core/ |
Tests block_rebuild(). | |||
| BlockRegion | class |
Drupal\ |
core/ |
Plugin annotation @MigrateProcessPlugin( id = "block_region" ) | 1 | ||
| BlockRegionTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\block\Plugin\migrate\process\BlockRegion @group block | |||
| BlockRenderAlterContent | class |
Drupal\ |
core/ |
Implements a trusted preRender callback. | |||
| BlockRenderOrderTest | class |
Drupal\ |
core/ |
Tests blocks are being rendered in order by weight. | |||
| BlockRepository | class |
Drupal\ |
core/ |
Provides a repository for Block config entities. | 1 | 2 | |
| BlockRepositoryInterface | interface |
Drupal\ |
core/ |
1 | 1 | ||
| BlockRepositoryTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\block\BlockRepository @group block | |||
| BlockResourceTestBase | abstract class |
Drupal\ |
core/ |
9 | 3 | ||
| BlockSettings | class |
Drupal\ |
core/ |
Plugin annotation @MigrateProcessPlugin( id = "block_settings" ) | 1 | ||
| BlockSettingsTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\block\Plugin\migrate\process\BlockSettings @group block | |||
| BlockStorageUnitTest | class |
Drupal\ |
core/ |
Tests the storage of blocks. | |||
| BlockSystemBrandingTest | class |
Drupal\ |
core/ |
Tests branding block display. | |||
| BlockTemplateSuggestionsTest | class |
Drupal\ |
core/ |
Tests the block_theme_suggestions_block() function. | |||
| BlockTest | class |
Drupal\ |
core/ |
JSON:API integration test for the "Block" config entity type. | |||
| BlockTest | class |
Drupal\ |
core/ |
Tests basic block functionality. | |||
| BlockTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\views\Plugin\views\display\Block @group block | |||
| BlockTest | class |
Drupal\ |
core/ |
Tests block source plugin. | 1 | 1 | |
| BlockTestBase | abstract class |
Drupal\ |
core/ |
Provides setup and helper methods for block module tests. | 2 | ||
| BlockTheme | class |
Drupal\ |
core/ |
Plugin annotation @MigrateProcessPlugin( id = "block_theme" ) | |||
| BlockTranslation | class |
Drupal\ |
core/ |
Gets i18n block data from source database. | |||
| BlockTranslation | class |
Drupal\ |
core/ |
Gets i18n block data from source database. | |||
| BlockTranslationTest | class |
Drupal\ |
core/ |
Tests i18n block source plugin. | |||
| BlockTranslationTest | class |
Drupal\ |
core/ |
Tests i18n block source plugin. | |||
| BlockUiTest | class |
Drupal\ |
core/ |
Tests that the block configuration UI exists and stores data correctly. | |||
| BlockUser | class |
Drupal\ |
core/ |
Blocks a user. | |||
| BlockViewBuilder | class |
Drupal\ |
core/ |
Provides a Block view builder. |