Classes, traits, and interfaces - 9.5.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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
Comment class Drupal\comment\Plugin\migrate\source\d7 core/modules/comment/src/Plugin/migrate/source/d7/Comment.php Drupal 7 comment source from database.
Comment class Drupal\d6_comment_test\Plugin\migrate\source\d6 core/modules/comment/tests/modules/d6_comment_test/src/Plugin/migrate/source/d6/Comment.php Test source plugin for deprecation testing.
CommentAccessControlHandler class Drupal\comment core/modules/comment/src/CommentAccessControlHandler.php Defines the access control handler for the comment entity type.
CommentAccessTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentAccessTest.php Tests comment administration and preview access.
CommentActionsTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentActionsTest.php Tests actions provided by the Comment module.
CommentAdminOverview class Drupal\comment\Form core/modules/comment/src/Form/CommentAdminOverview.php Provides the comments overview administration form. 1
CommentAdminTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentAdminTest.php Tests comment approval functionality.
CommentAdminTest class Drupal\Tests\comment\Functional\Views core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php Tests comment approval functionality.
CommentAdminViewTest class Drupal\Tests\comment\Kernel\Views core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php Tests comment admin view filters.
CommentAnonymousTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentAnonymousTest.php Tests anonymous commenting.
CommentApproveLinkTest class Drupal\Tests\comment\Functional\Views core/modules/comment/tests/src/Functional/Views/CommentApproveLinkTest.php Test the "approve_comment" views field for approving comments.
CommentAttributesTest class Drupal\Tests\rdf\Functional core/modules/rdf/tests/src/Functional/CommentAttributesTest.php Tests the RDFa markup of comments.
CommentBaseFieldTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentBaseFieldTest.php Tests that comment as a base field.
CommentBlockTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentBlockTest.php Tests comment block functionality.
CommentBookTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentBookTest.php Tests visibility of comments on book pages.
CommentBreadcrumbBuilder class Drupal\comment core/modules/comment/src/CommentBreadcrumbBuilder.php Class to define the comment breadcrumb builder. 2
CommentBulkForm class Drupal\comment\Plugin\views\field core/modules/comment/src/Plugin/views/field/CommentBulkForm.php Defines a comment operations bulk form element. 1
CommentBulkFormTest class Drupal\Tests\comment\Unit\Plugin\views\field core/modules/comment/tests/src/Unit/Plugin/views/field/CommentBulkFormTest.php @coversDefaultClass \Drupal\comment\Plugin\views\field\CommentBulkForm @group comment
CommentBundlesTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentBundlesTest.php Tests that comment bundles behave as expected.
CommentCacheTagsTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php Tests the Comment entity's cache tags.
CommentController class Drupal\comment\Controller core/modules/comment/src/Controller/CommentController.php Controller for the comment entity.
CommentCSSTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentCSSTest.php Tests CSS classes on comments.
CommentDefaultFormatter class Drupal\comment\Plugin\Field\FieldFormatter core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php Provides a default comment formatter.
CommentDefaultFormatterCacheTagsTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php Tests comment cache tag bubbling up when using the Comment list formatter.
CommentDepthTest class Drupal\Tests\comment\Kernel\Views core/modules/comment/tests/src/Kernel/Views/CommentDepthTest.php Tests the depth of the comment field handler.
CommentDisplayConfigurableTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentDisplayConfigurableTest.php Tests making comment base fields' displays configurable.
CommentedEntity class Drupal\comment\Plugin\views\field core/modules/comment/src/Plugin/views/field/CommentedEntity.php Views field display for commented entity.
CommentEditTest class Drupal\Tests\comment\Functional\Views core/modules/comment/tests/src/Functional/Views/CommentEditTest.php Tests comment edit functionality.
CommentEntityTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentEntityTest.php Tests comments with other entities.
CommentEntityTranslation class Drupal\comment\Plugin\migrate\source\d7 core/modules/comment/src/Plugin/migrate/source/d7/CommentEntityTranslation.php Drupal 7 comment entity translation source plugin.
CommentEntityTranslationCheckRequirementsTest class Drupal\Tests\comment\Kernel\Migrate\d7 core/modules/comment/tests/src/Kernel/Migrate/d7/CommentEntityTranslationCheckRequirementsTest.php Tests check requirements for comment entity translation source plugin.
CommentEntityTranslationTest class Drupal\Tests\comment\Kernel\Plugin\migrate\source\d7 core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d7/CommentEntityTranslationTest.php Tests D7 comment entity translation source plugin.
CommentFieldAccessTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php Tests comment field level access.
CommentFieldFilterTest class Drupal\Tests\comment\Functional\Views core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php Tests comment field filters with translations.
CommentFieldItemList class Drupal\comment core/modules/comment/src/CommentFieldItemList.php Defines an item list class for comment fields.
CommentFieldNameTest class Drupal\Tests\comment\Kernel\Views core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php Tests the comment field name field.
CommentFieldsTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentFieldsTest.php Tests fields on comments.
CommentForm class Drupal\comment core/modules/comment/src/CommentForm.php Base handler for comment forms.
CommentHalExportTest class Drupal\Tests\hal\Functional\comment\Views core/modules/hal/tests/src/Functional/comment/Views/CommentHalExportTest.php Tests a comment rest export view.
CommentHalJsonAnonTest class Drupal\Tests\hal\Functional\comment core/modules/hal/tests/src/Functional/comment/CommentHalJsonAnonTest.php @group hal @group legacy
CommentHalJsonBasicAuthTest class Drupal\Tests\hal\Functional\comment core/modules/hal/tests/src/Functional/comment/CommentHalJsonBasicAuthTest.php @group hal @group legacy
CommentHalJsonCookieTest class Drupal\Tests\hal\Functional\comment core/modules/hal/tests/src/Functional/comment/CommentHalJsonCookieTest.php @group hal @group legacy
CommentHalJsonTestBase abstract class Drupal\Tests\hal\Functional\comment core/modules/hal/tests/src/Functional/comment/CommentHalJsonTestBase.php 3
CommentHostnameTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentHostnameTest.php Tests the hostname base field.
CommentIntegrationTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php Tests integration of comment with other components.
CommentInterface interface Drupal\comment core/modules/comment/src/CommentInterface.php Provides an interface defining a comment entity. 1 38
CommentInterfaceTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentInterfaceTest.php Tests comment user interfaces.
CommentItem class Drupal\comment\Plugin\Field\FieldType core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php Plugin implementation of the 'comment' field type.
CommentItemInterface interface Drupal\comment\Plugin\Field\FieldType core/modules/comment/src/Plugin/Field/FieldType/CommentItemInterface.php Interface definition for Comment items. 1 37
CommentItemTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentItemTest.php Tests the new entity API for the comment field type.

Other projects


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