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

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
CommentStorage class Drupal\comment core/modules/comment/src/CommentStorage.php Defines the storage handler class for comments. 1
CommentStorageInterface interface Drupal\comment core/modules/comment/src/CommentStorageInterface.php Defines an interface for comment entity storage classes. 1 2
CommentStorageSchema class Drupal\comment core/modules/comment/src/CommentStorageSchema.php Defines the comment schema handler. 1
CommentStringIdEntitiesTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php Tests that comment fields cannot be added to entities with non-integer IDs.
CommentTest class Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6 core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d6/CommentTest.php Tests D6 comment source plugin.
CommentTest class Drupal\Tests\comment\Kernel\Plugin\migrate\source\d7 core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d7/CommentTest.php Tests D7 comment source plugin.
CommentTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/CommentTest.php JSON:API integration test for the "Comment" content entity type. 1
CommentTestBase abstract class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentTestBase.php Provides setup and helper methods for comment tests. 29 7
CommentTestBase abstract class Drupal\Tests\comment\Functional\Views core/modules/comment/tests/src/Functional/Views/CommentTestBase.php Provides setup and helper methods for comment views tests. 7 1
CommentTestBaseField class Drupal\comment_base_field_test\Entity core/modules/comment/tests/modules/comment_base_field_test/src/Entity/CommentTestBaseField.php Defines a test entity class for comment as a base field. 1
CommentTestController class Drupal\comment_test\Controller core/modules/comment/tests/modules/comment_test/src/Controller/CommentTestController.php Controller for the comment_test.module.
CommentTestHooks class Drupal\comment_test\Hook core/modules/comment/tests/modules/comment_test/src/Hook/CommentTestHooks.php Hook implementations for comment_test.
CommentTestTrait trait Drupal\comment\Tests core/modules/comment/src/Tests/CommentTestTrait.php Provides common functionality for the Comment test classes. 47
CommentThemeHooks class Drupal\comment\Hook core/modules/comment/src/Hook/CommentThemeHooks.php Hook implementations for comment. 1
CommentThreadingTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentThreadingTest.php Tests to make sure the comment number increments properly.
CommentTitleTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentTitleTest.php Tests that appropriate and accessible markup is created for comment titles.
CommentTokenReplaceTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php Tests comment token replacement.
CommentTokenReplaceTest class Drupal\Tests\history\Functional core/modules/history/tests/src/Functional/CommentTokenReplaceTest.php Tests comment token replacement.
CommentTokenReplaceTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentTokenReplaceTest.php Tests comment token replacement.
CommentTokensHooks class Drupal\comment\Hook core/modules/comment/src/Hook/CommentTokensHooks.php Hook implementations for comment.
CommentTranslationHandler class Drupal\comment core/modules/comment/src/CommentTranslationHandler.php Defines the translation handler for comments. 1
CommentTranslationUITest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentTranslationUITest.php Tests the Comment Translation UI.
CommentType class Drupal\comment\Entity core/modules/comment/src/Entity/CommentType.php Defines the comment type entity. 33
CommentType class Drupal\comment\Plugin\migrate\source core/modules/comment/src/Plugin/migrate/source/CommentType.php Drupal 6/7 comment types source from database. 1
CommentTypeDeleteForm class Drupal\comment\Form core/modules/comment/src/Form/CommentTypeDeleteForm.php Provides a confirmation form for deleting a comment type entity. 1
CommentTypeForm class Drupal\comment core/modules/comment/src/CommentTypeForm.php Base form handler for comment type edit forms. 1
CommentTypeInterface interface Drupal\comment core/modules/comment/src/CommentTypeInterface.php Provides an interface defining a comment type entity. 1 1
CommentTypeJsonAnonTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeJsonAnonTest.php Tests Comment Type Json Anon.
CommentTypeJsonBasicAuthTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeJsonBasicAuthTest.php Tests Comment Type Json Basic Auth.
CommentTypeJsonCookieTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeJsonCookieTest.php Tests Comment Type Json Cookie.
CommentTypeListBuilder class Drupal\comment core/modules/comment/src/CommentTypeListBuilder.php Defines a class to build a listing of comment type entities. 1
CommentTypeRequirementsTest class Drupal\Tests\comment\Kernel\Plugin\migrate\source core/modules/comment/tests/src/Kernel/Plugin/migrate/source/CommentTypeRequirementsTest.php Tests check requirements for comment type source plugin.
CommentTypeResourceTestBase abstract class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeResourceTestBase.php Resource test base for CommentType entity. 6
CommentTypeTest class Drupal\Tests\comment\Kernel\Plugin\migrate\source core/modules/comment/tests/src/Kernel/Plugin/migrate/source/CommentTypeTest.php Tests the comment type source plugin.
CommentTypeTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentTypeTest.php Ensures that comment type functions work correctly.
CommentTypeTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/CommentTypeTest.php JSON:API integration test for the "CommentType" config entity type.
CommentTypeValidationTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentTypeValidationTest.php Tests validation of comment_type entities.
CommentTypeXmlAnonTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeXmlAnonTest.php Tests Comment Type Xml Anon.
CommentTypeXmlBasicAuthTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeXmlBasicAuthTest.php Tests Comment Type Xml Basic Auth.
CommentTypeXmlCookieTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeXmlCookieTest.php Tests Comment Type Xml Cookie.
CommentUninstallTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentUninstallTest.php Tests comment module uninstall.
CommentUriDeprecationTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentUriDeprecationTest.php Performs kernel tests on the deprecation of the comment_uri method.
CommentUserNameTest class Drupal\Tests\comment\Kernel\Views core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php Tests comment user name field.
CommentValidationTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentValidationTest.php Tests comment validation constraints.
CommentViewBuilder class Drupal\comment core/modules/comment/src/CommentViewBuilder.php View builder handler for comments. 1
CommentViewsData class Drupal\comment core/modules/comment/src/CommentViewsData.php Provides views data for the comment entity type. 1
CommentViewsFieldAccessTest class Drupal\Tests\comment\Kernel\Views core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php Tests base field access in Views for the comment entity.
CommentViewsHooks class Drupal\comment\Hook core/modules/comment/src/Hook/CommentViewsHooks.php Hook implementations for comment.
CommentViewsKernelTestBase abstract class Drupal\Tests\comment\Kernel\Views core/modules/comment/tests/src/Kernel/Views/CommentViewsKernelTestBase.php Provides a common test base for comment views tests. 2
CommentWidget class Drupal\comment\Plugin\Field\FieldWidget core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php Provides a default comment widget.

Other projects


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