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
CommentNameConstraintValidator class Drupal\comment\Plugin\Validation\Constraint core/modules/comment/src/Plugin/Validation/Constraint/CommentNameConstraintValidator.php Validates the CommentName constraint.
CommentNewIndicatorTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php Tests the 'new' indicator posted on comments.
CommentNodeAccessTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php Tests comments with node access.
CommentNodeChangesTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentNodeChangesTest.php Tests that comments behave correctly when the node is changed.
CommentNonNodeTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentNonNodeTest.php Tests commenting on a test entity.
CommentOperationsTest class Drupal\Tests\comment\Functional\Views core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php Tests comment operations.
CommentOrphanTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentOrphanTest.php Tests loading and rendering orphan comments.
CommentPagerTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentPagerTest.php Tests paging of comments and their settings.
CommentPermalinkFormatter class Drupal\comment\Plugin\Field\FieldFormatter core/modules/comment/src/Plugin/Field/FieldFormatter/CommentPermalinkFormatter.php Plugin implementation of the 'comment_permalink' formatter.
CommentPreviewTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentPreviewTest.php Tests comment preview.
CommentResourceTestBase abstract class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php 8 2
CommentResourceTestBase

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

abstract class Drupal\Tests\rest\Functional\EntityResource\Comment core/modules/rest/tests/src/Functional/EntityResource/Comment/CommentResourceTestBase.php
CommentRestExportTest class Drupal\Tests\comment\Functional\Views core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php Tests a comment rest export view.
CommentRowTest class Drupal\Tests\comment\Functional\Views core/modules/comment/tests/src/Functional/Views/CommentRowTest.php Tests the comment row plugin.
CommentRssTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentRssTest.php Tests comments as part of an RSS feed.
CommentSelection class Drupal\comment\Plugin\EntityReferenceSelection core/modules/comment/src/Plugin/EntityReferenceSelection/CommentSelection.php Provides specific access control for the comment entity type.
CommentSourceWithHighWaterTest class Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6 core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d6/CommentSourceWithHighWaterTest.php Tests the Drupal 6 comment source w/ high water handling.
CommentStatistics class Drupal\comment core/modules/comment/src/CommentStatistics.php 1 2
CommentStatisticsInterface interface Drupal\comment core/modules/comment/src/CommentStatisticsInterface.php Provides an interface for storing and retrieving comment statistics. 1 1
CommentStatisticsTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentStatisticsTest.php Tests comment statistics on nodes.
CommentStatisticsUnitTest class Drupal\Tests\comment\Unit core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php @coversDefaultClass \Drupal\comment\CommentStatistics @group comment
CommentStatusFieldAccessTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php Tests comment status field access.
CommentStorage class Drupal\comment core/modules/comment/src/CommentStorage.php Defines the storage handler class for comments.
CommentStorageInterface interface Drupal\comment core/modules/comment/src/CommentStorageInterface.php Defines an interface for comment entity storage classes. 1 1
CommentStorageSchema class Drupal\comment core/modules/comment/src/CommentStorageSchema.php Defines the comment schema handler.
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.
CommentTestBase

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\comment\Functional\CommentTestBase instead.

abstract class Drupal\comment\Tests core/modules/comment/src/Tests/CommentTestBase.php Provides setup and helper methods for comment tests.
CommentTestBase

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\comment\Functional\Views\CommentTestBase instead.

abstract class Drupal\comment\Tests\Views core/modules/comment/src/Tests/Views/CommentTestBase.php Provides setup and helper methods for comment views tests.
CommentTestBase abstract class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentTestBase.php Provides setup and helper methods for comment tests. 24 3
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. 6
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.
CommentTestTrait trait Drupal\comment\Tests core/modules/comment/src/Tests/CommentTestTrait.php Provides common functionality for the Comment test classes. 45
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 to ensure that appropriate and accessible markup is created for comment titles.
CommentTokenReplaceTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php Generates text using placeholders for dummy content to check comment token replacement.
CommentTranslationHandler class Drupal\comment core/modules/comment/src/CommentTranslationHandler.php Defines the translation handler for comments.
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. 28
CommentType

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\node\Plugin\migrate\source\d7\NodeType instead.

class Drupal\comment\Plugin\migrate\source\d7 core/modules/comment/src/Plugin/migrate/source/d7/CommentType.php Drupal 7 comment type source from database.
CommentTypeDeleteForm class Drupal\comment\Form core/modules/comment/src/Form/CommentTypeDeleteForm.php Provides a confirmation form for deleting a comment type entity.
CommentTypeForm class Drupal\comment core/modules/comment/src/CommentTypeForm.php Base form handler for comment type edit forms.
CommentTypeHalJsonAnonTest class Drupal\Tests\comment\Functional\Hal core/modules/comment/tests/src/Functional/Hal/CommentTypeHalJsonAnonTest.php @group hal
CommentTypeHalJsonBasicAuthTest class Drupal\Tests\comment\Functional\Hal core/modules/comment/tests/src/Functional/Hal/CommentTypeHalJsonBasicAuthTest.php @group hal
CommentTypeHalJsonCookieTest class Drupal\Tests\comment\Functional\Hal core/modules/comment/tests/src/Functional/Hal/CommentTypeHalJsonCookieTest.php @group hal
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 @group rest

Other projects


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