Classes, traits, and interfaces in Drupal 8
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 |
|---|---|---|---|---|---|---|---|
| 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 | |||
| BlockPageDisplayVariantSubscriber | class |
Drupal\ |
core/ |
Selects the block page display variant. | 2 | ||
| BlockPageSettingTest | class |
Drupal\ |
core/ |
Tests search blocks upgrade to default page setting. | |||
| BlockPageVariant | class |
Drupal\ |
core/ |
Provides a page display variant that decorates the main content with blocks. | 1 | 1 | |
| BlockPageVariantTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\block\Plugin\DisplayVariant\BlockPageVariant @group block | |||
| BlockPlaceEventSubscriber | class |
Drupal\ |
core/ |
2 | |||
| BlockPlaceTest | class |
Drupal\ |
core/ |
Tests the placing a 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" ) | 1 | ||
| BlockPluginInterface | interface |
Drupal\ |
core/ |
Defines the required interface for all block plugins. | 7 | 21 | |
| 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 | |||
| BlockRemoveDisabledRegionUpdateTest | class |
Drupal\ |
core/ |
Tests the upgrade path for removal of disabled region. | |||
| 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 | 2 | ||
| BlockRepositoryTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\block\BlockRepository @group block | |||
| BlockResourceTestBase | abstract class |
Drupal\ |
core/ |
10 | 4 | ||
| BlockResourceTestBase Deprecated | abstract class |
Drupal\ |
core/ |
||||
| BlockSettings | class |
Drupal\ |
core/ |
Plugin annotation @MigrateProcessPlugin( id = "block_settings" ) | |||
| 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 Deprecated | abstract class |
Drupal\ |
core/ |
Provides setup and helper methods for block module tests. | |||
| 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. | |||
| BlockViewBuilderTest | class |
Drupal\ |
core/ |
Tests the block view builder. | |||
| BlockVisibility | class |
Drupal\ |
core/ |
Plugin annotation @MigrateProcessPlugin( id = "block_visibility" ) | 2 | ||
| BlockVisibilityTest | class |
Drupal\ |
core/ |
Tests the block_visibility process plugin. | |||
| BlockXmlAnonTest | class |
Drupal\ |
core/ |
@group rest | |||
| BlockXmlBasicAuthTest | class |
Drupal\ |
core/ |
@group rest | |||
| BlockXmlCookieTest | class |
Drupal\ |
core/ |
@group rest | |||
| BlockXssTest | class |
Drupal\ |
core/ |
Tests that the block module properly escapes block descriptions. |