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
BlockRepository class Drupal\block core/modules/block/src/BlockRepository.php Provides a repository for Block config entities. 2 2
BlockRepositoryInterface interface Drupal\block core/modules/block/src/BlockRepositoryInterface.php 1 1
BlockRepositoryTest class Drupal\Tests\block\Unit core/modules/block/tests/src/Unit/BlockRepositoryTest.php @coversDefaultClass \Drupal\block\BlockRepository @group block
BlockResourceTestBase abstract class Drupal\Tests\block\Functional\Rest core/modules/block/tests/src/Functional/Rest/BlockResourceTestBase.php 6
BlockSettings class Drupal\block\Plugin\migrate\process core/modules/block/src/Plugin/migrate/process/BlockSettings.php Determines the block settings. 1
BlockSettingsTest class Drupal\Tests\block\Unit\Plugin\migrate\process core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php @coversDefaultClass \Drupal\block\Plugin\migrate\process\BlockSettings @group block
BlockStorageUnitTest class Drupal\Tests\block\Kernel core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php Tests the storage of blocks.
BlockSystemBrandingTest class Drupal\Tests\block\Functional core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php Tests branding block display.
BlockTemplateSuggestionsTest class Drupal\Tests\block\Kernel core/modules/block/tests/src/Kernel/BlockTemplateSuggestionsTest.php Tests the block_theme_suggestions_block() function.
BlockTemplateSuggestionsTest class Drupal\Tests\block_content\Kernel core/modules/block_content/tests/src/Kernel/BlockTemplateSuggestionsTest.php Tests the block_content_theme_suggestions_block() function.
BlockTest class Drupal\Tests\block\Kernel\Plugin\migrate\source core/modules/block/tests/src/Kernel/Plugin/migrate/source/BlockTest.php Tests block source plugin. 1 1
BlockTest class Drupal\Tests\block\Functional core/modules/block/tests/src/Functional/BlockTest.php Tests basic block functionality.
BlockTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/BlockTest.php JSON:API integration test for the "Block" config entity type.
BlockTest class Drupal\Tests\views\Unit\Plugin\views\display core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php @coversDefaultClass \Drupal\views\Plugin\views\display\Block @group block
BlockTestBase abstract class Drupal\Tests\block\Functional core/modules/block/tests/src/Functional/BlockTestBase.php Provides setup and helper methods for block module tests. 2
BlockTheme class Drupal\block\Plugin\migrate\process core/modules/block/src/Plugin/migrate/process/BlockTheme.php 1
BlockThemeDeprecationTest class Drupal\Tests\block\Unit\Plugin\migrate\process core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockThemeDeprecationTest.php Tests the deprecation notices of the block theme.
BlockTranslation class Drupal\block\Plugin\migrate\source\d6 core/modules/block/src/Plugin/migrate/source/d6/BlockTranslation.php Drupal 6 i18n block data from database.
BlockTranslation class Drupal\block\Plugin\migrate\source\d7 core/modules/block/src/Plugin/migrate/source/d7/BlockTranslation.php Drupal 7 i18n block data from database.
BlockTranslationTest class Drupal\Tests\block\Kernel\Plugin\migrate\source\d6 core/modules/block/tests/src/Kernel/Plugin/migrate/source/d6/BlockTranslationTest.php Tests i18n block source plugin.
BlockTranslationTest class Drupal\Tests\block\Kernel\Plugin\migrate\source\d7 core/modules/block/tests/src/Kernel/Plugin/migrate/source/d7/BlockTranslationTest.php Tests i18n block source plugin.
BlockTypeAccessControlHandler class Drupal\block_content core/modules/block_content/src/BlockTypeAccessControlHandler.php Defines the access control handler for the "Block Type" entity type.
BlockUiTest class Drupal\Tests\block\Functional core/modules/block/tests/src/Functional/BlockUiTest.php Tests that the block configuration UI exists and stores data correctly.
BlockUser class Drupal\user\Plugin\Action core/modules/user/src/Plugin/Action/BlockUser.php Blocks a user.
BlockValidationTest class Drupal\Tests\block\Kernel core/modules/block/tests/src/Kernel/BlockValidationTest.php Tests validation of block entities.
BlockViewBuilder class Drupal\block core/modules/block/src/BlockViewBuilder.php Provides a Block view builder.
BlockViewBuilderTest class Drupal\Tests\block\Kernel core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php Tests the block view builder.
BlockVisibility class Drupal\block\Plugin\migrate\process core/modules/block/src/Plugin/migrate/process/BlockVisibility.php 1
BlockVisibilityTest class Drupal\Tests\block\Unit\Plugin\migrate\process core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php Tests the block_visibility process plugin.
BlockXmlAnonTest class Drupal\Tests\block\Functional\Rest core/modules/block/tests/src/Functional/Rest/BlockXmlAnonTest.php @group rest
BlockXmlBasicAuthTest class Drupal\Tests\block\Functional\Rest core/modules/block/tests/src/Functional/Rest/BlockXmlBasicAuthTest.php @group rest
BlockXmlCookieTest class Drupal\Tests\block\Functional\Rest core/modules/block/tests/src/Functional/Rest/BlockXmlCookieTest.php @group rest
BlockXssTest class Drupal\Tests\block\Functional core/modules/block/tests/src/Functional/BlockXssTest.php Tests that the block module properly escapes block descriptions.
Book class Drupal\book\Plugin\migrate\destination core/modules/book/src/Plugin/migrate/destination/Book.php Provides migrate destination plugin for Book content.
Book class Drupal\book\Plugin\migrate\source core/modules/book/src/Plugin/migrate/source/Book.php Drupal 6/7 book source from database.
BookAdminEditForm class Drupal\book\Form core/modules/book/src/Form/BookAdminEditForm.php Provides a form for administering a single book's hierarchy. 1
BookBreadcrumbBuilder class Drupal\book core/modules/book/src/BookBreadcrumbBuilder.php Provides a breadcrumb builder for nodes in a book. 2
BookBreadcrumbTest class Drupal\Tests\book\Functional core/modules/book/tests/src/Functional/BookBreadcrumbTest.php Create a book, add pages, and test book interface.
BookContentModerationTest class Drupal\Tests\book\Functional core/modules/book/tests/src/Functional/BookContentModerationTest.php Tests Book and Content Moderation integration.
BookController class Drupal\book\Controller core/modules/book/src/Controller/BookController.php Controller routines for book routes.
BookExport class Drupal\book core/modules/book/src/BookExport.php Provides methods for exporting book to different formats. 1 2
BookInstallTest class Drupal\Tests\book\Kernel core/modules/book/tests/src/Kernel/BookInstallTest.php Test installation of Book module.
BookJavascriptTest class Drupal\Tests\book\FunctionalJavascript core/modules/book/tests/src/FunctionalJavascript/BookJavascriptTest.php Tests Book javascript functionality.
BookLocalTasksTest class Drupal\Tests\book\Unit\Menu core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php Tests existence of book local tasks.
BookManager class Drupal\book\ProxyClass core/modules/book/src/ProxyClass/BookManager.php Provides a proxy class for \Drupal\book\BookManager.
BookManager class Drupal\book core/modules/book/src/BookManager.php Defines a book manager. 3 2
BookManagerInterface interface Drupal\book core/modules/book/src/BookManagerInterface.php Provides an interface defining a book manager. 2 8
BookManagerTest class Drupal\Tests\book\Unit core/modules/book/tests/src/Unit/BookManagerTest.php @coversDefaultClass \Drupal\book\BookManager @group book @group legacy
BookMultilingualTest class Drupal\Tests\book\Kernel core/modules/book/tests/src/Kernel/BookMultilingualTest.php Tests multilingual books.
BookNavigationBlock class Drupal\book\Plugin\Block core/modules/book/src/Plugin/Block/BookNavigationBlock.php Provides a 'Book navigation' block.

Other projects


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