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
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 the bubbling up of comment cache tags when using the Comment list formatter on an entity.
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 Provides Drupal 7 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 a 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.
CommentHalJsonAnonTest class Drupal\Tests\comment\Functional\Hal core/modules/comment/tests/src/Functional/Hal/CommentHalJsonAnonTest.php @group hal
CommentHalJsonBasicAuthTest class Drupal\Tests\comment\Functional\Hal core/modules/comment/tests/src/Functional/Hal/CommentHalJsonBasicAuthTest.php @group hal
CommentHalJsonCookieTest class Drupal\Tests\comment\Functional\Hal core/modules/comment/tests/src/Functional/Hal/CommentHalJsonCookieTest.php @group hal
CommentHalJsonTestBase abstract class Drupal\Tests\comment\Functional\Hal core/modules/comment/tests/src/Functional/Hal/CommentHalJsonTestBase.php 4 1
CommentHalJsonTestBase

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\comment\Functional\Hal\CommentHalJsonTestBase instead.

abstract class Drupal\Tests\hal\Functional\EntityResource\Comment core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php
CommentHostnameTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentHostnameTest.php Tests the hostname base field.
CommentHostnameUpdateTest class Drupal\Tests\comment\Functional\Update core/modules/comment/tests/src/Functional/Update/CommentHostnameUpdateTest.php Tests that comment hostname settings are properly updated.
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 39
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 39
CommentItemTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentItemTest.php Tests the new entity API for the comment field type.
CommentJsonAnonTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentJsonAnonTest.php @group rest
CommentJsonBasicAuthTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentJsonBasicAuthTest.php @group rest
CommentJsonCookieTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentJsonCookieTest.php @group rest
CommentLanguageTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentLanguageTest.php Tests for comment language.
CommentLazyBuilders class Drupal\comment core/modules/comment/src/CommentLazyBuilders.php Defines a service for comment #lazy_builder callbacks. 2
CommentLegacyTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentLegacyTest.php Tests legacy comment functionality.
CommentLinkBuilder class Drupal\comment core/modules/comment/src/CommentLinkBuilder.php Defines a class for building markup for comment links on a commented entity. 1 2
CommentLinkBuilderInterface interface Drupal\comment core/modules/comment/src/CommentLinkBuilderInterface.php Defines an interface for building comment links on a commented entity. 1
CommentLinkBuilderTest class Drupal\Tests\comment\Unit core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php @coversDefaultClass \Drupal\comment\CommentLinkBuilder @group comment
CommentLinksAlterTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php Tests comment links altering.
CommentLinksTest class Drupal\Tests\comment\Kernel\Views core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php Tests the comment link field handlers.
CommentLinksTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentLinksTest.php Basic comment links tests to ensure markup present.
CommentLockTest class Drupal\Tests\comment\Unit\Entity core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php Tests comment acquires and releases the right lock.
CommentManager class Drupal\comment core/modules/comment/src/CommentManager.php Comment manager contains common functions to manage comment fields. 1 2
CommentManagerInterface interface Drupal\comment core/modules/comment/src/CommentManagerInterface.php Comment manager contains common functions to manage comment fields. 1 13
CommentManagerTest class Drupal\Tests\comment\Unit core/modules/comment/tests/src/Unit/CommentManagerTest.php @coversDefaultClass \Drupal\comment\CommentManager @group comment
CommentNameConstraint class Drupal\comment\Plugin\Validation\Constraint core/modules/comment/src/Plugin/Validation/Constraint/CommentNameConstraint.php Supports validating comment author names.

Other projects


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