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
Book class Drupal\book\Plugin\migrate\destination core/modules/book/src/Plugin/migrate/destination/Book.php Plugin annotation @MigrateDestination( id = "book", provider = "book" )
Book

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal\book\Plugin\migrate\source\Book instead. See https://www.drupal.org/node/2947487 for more information.

class Drupal\book\Plugin\migrate\source\d6 core/modules/book/src/Plugin/migrate/source/d6/Book.php Drupal 6 book source. 1
Book class Drupal\book\Plugin\migrate\source core/modules/book/src/Plugin/migrate/source/Book.php Drupal 6 and 7 book source. 1 1
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 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. 1 7
BookManagerTest class Drupal\Tests\book\Unit core/modules/book/tests/src/Unit/BookManagerTest.php @coversDefaultClass \Drupal\book\BookManager @group book
BookNavigationBlock class Drupal\book\Plugin\Block core/modules/book/src/Plugin/Block/BookNavigationBlock.php Provides a 'Book navigation' block.
BookNavigationCacheContext class Drupal\book\Cache core/modules/book/src/Cache/BookNavigationCacheContext.php Defines the book navigation cache context service. 2
BookNodeIsRemovableAccessCheck class Drupal\book\Access core/modules/book/src/Access/BookNodeIsRemovableAccessCheck.php Determines whether the requested node can be removed from its book. 2
BookOutline class Drupal\book core/modules/book/src/BookOutline.php Provides handling to render the book outline. 2
BookOutlineConstraint class Drupal\book\Plugin\Validation\Constraint core/modules/book/src/Plugin/Validation/Constraint/BookOutlineConstraint.php Validation constraint for changing the book outline in pending revisions.
BookOutlineConstraintValidator class Drupal\book\Plugin\Validation\Constraint core/modules/book/src/Plugin/Validation/Constraint/BookOutlineConstraintValidator.php Constraint validator for changing the book outline in pending revisions.
BookOutlineForm class Drupal\book\Form core/modules/book/src/Form/BookOutlineForm.php Displays the book outline form.
BookOutlineStorage class Drupal\book core/modules/book/src/BookOutlineStorage.php Defines a storage class for books outline. 2
BookOutlineStorageInterface interface Drupal\book core/modules/book/src/BookOutlineStorageInterface.php Defines a common interface for book outline storage classes. 1
BookPendingRevisionTest class Drupal\Tests\book\Kernel core/modules/book/tests/src/Kernel/BookPendingRevisionTest.php Tests that the Book module handles pending revisions correctly.
BookRelationshipTest class Drupal\Tests\book\Functional\Views core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php Tests entity reference relationship data.
BookRemoveForm class Drupal\book\Form core/modules/book/src/Form/BookRemoveForm.php Remove form for book module. 1
BookSettingsForm class Drupal\book\Form core/modules/book/src/Form/BookSettingsForm.php Configure book settings for this site. 1
BookTest class Drupal\Tests\book\Kernel\Plugin\migrate\source core/modules/book/tests/src/Kernel/Plugin/migrate/source/BookTest.php @covers \Drupal\book\Plugin\migrate\source\Book @group book @group legacy
BookTest class Drupal\Tests\book\Functional core/modules/book/tests/src/Functional/BookTest.php Create a book, add pages, and test book interface.
BookTestTrait trait Drupal\Tests\book\Functional core/modules/book/tests/src/Functional/BookTestTrait.php Provides common functionality for Book test classes.
BookUninstallTest class Drupal\Tests\book\Kernel core/modules/book/tests/src/Kernel/BookUninstallTest.php Tests that the Book module cannot be uninstalled if books exist.
BookUninstallValidator class Drupal\book\ProxyClass core/modules/book/src/ProxyClass/BookUninstallValidator.php Provides a proxy class for \Drupal\book\BookUninstallValidator.
BookUninstallValidator class Drupal\book core/modules/book/src/BookUninstallValidator.php Prevents book module from being uninstalled whilst any book nodes exist or there are any book outline stored. 2
BookUninstallValidatorTest class Drupal\Tests\book\Unit core/modules/book/tests/src/Unit/BookUninstallValidatorTest.php @coversDefaultClass \Drupal\book\BookUninstallValidator @group book
Boolean class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/Boolean.php A handler to provide proper displays for booleans.
BooleanCheckboxWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php Plugin implementation of the 'boolean_checkbox' widget.
BooleanData class Drupal\Core\TypedData\Plugin\DataType core/lib/Drupal/Core/TypedData/Plugin/DataType/BooleanData.php The boolean data type. 4 1
BooleanFieldTest class Drupal\Tests\field\Functional\Boolean core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php Tests boolean field functionality.
BooleanFilterValuesUpdateTest class Drupal\Tests\views\Functional\Update core/modules/views/tests/src/Functional/Update/BooleanFilterValuesUpdateTest.php Tests the upgrade path for boolean field values.
BooleanFormatter class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/BooleanFormatter.php Plugin implementation of the 'boolean' formatter.
BooleanFormatterSettingsTest class Drupal\Tests\field\FunctionalJavascript\Boolean core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php Tests the Boolean field formatter settings.
BooleanFormatterSettingsTest class Drupal\Tests\field\Functional\Boolean core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php Tests the Boolean field formatter settings.
BooleanFormatterTest class Drupal\Tests\field\Kernel\Boolean core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php Tests the boolean formatter.
BooleanInterface interface Drupal\Core\TypedData\Type core/lib/Drupal/Core/TypedData/Type/BooleanInterface.php Interface for boolean data. 1 4
BooleanItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php Defines the 'boolean' entity field type. 1 6
BooleanItemNormalizer class Drupal\test_fieldtype_boolean_emoji_normalizer\Normalizer core/modules/serialization/tests/modules/test_fieldtype_boolean_emoji_normalizer/src/Normalizer/BooleanItemNormalizer.php Normalizes boolean fields weirdly: renders them as ๐Ÿ‘ (TRUE) or ๐Ÿ‘Ž (FALSE). 2
BooleanItemTest class Drupal\Tests\field\Kernel\Boolean core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php Tests the new entity API for the boolean field type.
BooleanNormalizer class Drupal\test_datatype_boolean_emoji_normalizer\Normalizer core/modules/serialization/tests/modules/test_datatype_boolean_emoji_normalizer/src/Normalizer/BooleanNormalizer.php Normalizes boolean data weirdly: renders them as ๐Ÿ‘ (TRUE) or ๐Ÿ‘Ž (FALSE). 2
BooleanOperator class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/BooleanOperator.php Simple filter to handle matching of boolean values 3 2

Other projects


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