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
CommentTypeJsonBasicAuthTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeJsonBasicAuthTest.php @group rest
CommentTypeJsonCookieTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeJsonCookieTest.php @group rest
CommentTypeListBuilder class Drupal\comment core/modules/comment/src/CommentTypeListBuilder.php Defines a class to build a listing of comment type entities.
CommentTypeResourceTestBase abstract class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeResourceTestBase.php ResourceTestBase for CommentType entity. 10 4
CommentTypeResourceTestBase

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

abstract class Drupal\Tests\rest\Functional\EntityResource\CommentType core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php
CommentTypeTest class Drupal\Tests\comment\Kernel\Plugin\migrate\source\d7 core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d7/CommentTypeTest.php Tests D7 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.
CommentTypeXmlAnonTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeXmlAnonTest.php @group rest
CommentTypeXmlBasicAuthTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeXmlBasicAuthTest.php @group rest
CommentTypeXmlCookieTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentTypeXmlCookieTest.php @group rest
CommentUninstallTest class Drupal\Tests\comment\Kernel core/modules/comment/tests/src/Kernel/CommentUninstallTest.php Tests comment module uninstall.
CommentUpdateTest class Drupal\Tests\comment\Functional\Update core/modules/comment/tests/src/Functional/Update/CommentUpdateTest.php Tests that comment settings are properly updated during database updates.
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.
CommentVariable

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

class Drupal\comment\Plugin\migrate\source\d6 core/modules/comment/src/Plugin/migrate/source/d6/CommentVariable.php Plugin annotation @MigrateSource( id = "d6_comment_variable", source_module = "comment" ) 1
CommentVariablePerCommentType

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

class Drupal\comment\Plugin\migrate\source\d6 core/modules/comment/src/Plugin/migrate/source/d6/CommentVariablePerCommentType.php Plugin annotation @MigrateSource( id = "d6_comment_variable_per_comment_type", source_module = "comment" )
CommentVariablePerCommentTypeTest class Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6 core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d6/CommentVariablePerCommentTypeTest.php Tests comment variable per comment type source plugin.
CommentVariableTest class Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6 core/modules/comment/tests/src/Kernel/Plugin/migrate/source/d6/CommentVariableTest.php Tests d6_comment_variable source plugin.
CommentViewBuilder class Drupal\comment core/modules/comment/src/CommentViewBuilder.php View builder handler for comments.
CommentViewsData class Drupal\comment core/modules/comment/src/CommentViewsData.php Provides views data for the comment entity type.
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.
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. 1
CommentWidget class Drupal\comment\Plugin\Field\FieldWidget core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php Provides a default comment widget.
CommentXmlAnonTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentXmlAnonTest.php @group rest
CommentXmlBasicAuthTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php @group rest
CommentXmlCookieTest class Drupal\Tests\comment\Functional\Rest core/modules/comment/tests/src/Functional/Rest/CommentXmlCookieTest.php @group rest
CommonCollectionFilterAccessTestPatternsTrait trait Drupal\Tests\jsonapi\Traits core/modules/jsonapi/tests/src/Traits/CommonCollectionFilterAccessTestPatternsTrait.php Provides common filter access control tests. 9
CommonDataConverter class Drupal\rdf core/modules/rdf/src/CommonDataConverter.php Contains methods for common data conversions.
CommonTestController class Drupal\common_test\Controller core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php Controller routines for common_test routes.
CompatibilityFixTest class Drupal\KernelTests\Core\Update core/tests/Drupal/KernelTests/Core/Update/CompatibilityFixTest.php Tests that extensions that are incompatible with the current core version are disabled.
CompiledRoute class Drupal\Core\Routing core/lib/Drupal/Core/Routing/CompiledRoute.php A compiled route contains derived information from a route object.
ComplexDataConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ComplexDataConstraint.php Complex data constraint.
ComplexDataConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ComplexDataConstraintValidator.php Validates complex data.
ComplexDataConstraintValidatorTest class Drupal\KernelTests\Core\TypedData core/tests/Drupal/KernelTests/Core/TypedData/ComplexDataConstraintValidatorTest.php Tests ComplexData validation constraint with both valid and invalid values for a key.
ComplexDataDefinitionBase abstract class Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/ComplexDataDefinitionBase.php Base class for complex data definitions. 2 1
ComplexDataDefinitionInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/ComplexDataDefinitionInterface.php Interface for complex data definitions. 3 7
ComplexDataInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/ComplexDataInterface.php Interface for complex data; i.e. data containing named and typed properties. 4 15
ComplexDataNormalizer class Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/ComplexDataNormalizer.php Converts the Drupal entity object structures to a normalized array. 3 1 2
ComplexDataNormalizerTest class Drupal\Tests\serialization\Unit\Normalizer core/modules/serialization/tests/src/Unit/Normalizer/ComplexDataNormalizerTest.php @coversDefaultClass \Drupal\serialization\Normalizer\ComplexDataNormalizer @group serialization
ComplexTestType class Drupal\workflow_type_test\Plugin\WorkflowType core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/ComplexTestType.php Test workflow type.
ComplexTestTypeConfigureForm class Drupal\workflow_type_test\Form core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeConfigureForm.php Form to configure the complex test workflow type.
ComplexTestTypeStateForm class Drupal\workflow_type_test\Form core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php Form to configure the complex test workflow states.
ComplexTestTypeTransitionForm class Drupal\workflow_type_test\Form core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeTransitionForm.php Form to configure the complex test workflow states.
ComplexWorkflowTypeTest class Drupal\Tests\workflows\Kernel core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php Workflow entity tests that require modules or storage.
ComponentEntityDisplayBase abstract class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/ComponentEntityDisplayBase.php Provides a destination plugin for migrating entity display components. 3 2
Composer class Drupal\Composer composer/Composer.php Provides static functions for composer script events. See also core/lib/Drupal/Composer/Composer.php, which contains similar scripts needed by projects that include drupal/core. Scripts that are only needed by drupal/drupal go here. 5
Composer class Drupal\Core\Composer core/lib/Drupal/Core/Composer/Composer.php Provides static functions for composer script events.
ComposerHookTest class Drupal\Tests\Composer\Plugin\Scaffold\Functional core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php Tests Composer Hooks that run scaffold operations.
ComposerIntegrationTest class Drupal\Tests core/tests/Drupal/Tests/ComposerIntegrationTest.php Tests Composer integration.

Other projects


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