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
ClassyTemplatesIdenticalToStableTest class Drupal\Tests\Core\Theme core/tests/Drupal/Tests/Core/Theme/ClassyTemplatesIdenticalToStableTest.php Confirms that certain Classy templates have identical equivalents in Stable.
ClassyTest class Drupal\FunctionalTests\Theme core/tests/Drupal/FunctionalTests/Theme/ClassyTest.php Tests the classy theme.
ClassyTest class Drupal\Tests\system\Kernel\Render core/modules/system/tests/src/Kernel/Render/ClassyTest.php Tests the Classy theme.
ClearTest class Drupal\Tests\system\Functional\Cache core/modules/system/tests/src/Functional/Cache/ClearTest.php
ClickSortingAJAXTest class Drupal\Tests\views\FunctionalJavascript core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php Tests the click sorting AJAX functionality of Views exposed forms.
ClientErrorResponseSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/ClientErrorResponseSubscriber.php Response subscriber to set the '4xx-response' cache tag on 4xx responses. 2
ClientFactory class Drupal\Core\Http core/lib/Drupal/Core/Http/ClientFactory.php Helper class to construct a HTTP client with Drupal specific config. 2 2
ClientFactoryTest class Drupal\Tests\Core\Http core/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php @coversDefaultClass \Drupal\Core\Http\ClientFactory @group Http
CloseDialogCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/CloseDialogCommand.php Defines an AJAX command that closes the current active dialog. 1 6
CloseModalDialogCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/CloseModalDialogCommand.php Defines an AJAX command that closes the currently visible modal dialog. 5
CollectRoutesTest class Drupal\Tests\rest\Unit core/modules/rest/tests/src/Unit/CollectRoutesTest.php Tests the REST export view plugin.
Color class Drupal\color\Plugin\migrate\destination core/modules/color/src/Plugin/migrate/destination/Color.php Persist color data to the config system. 1
Color class Drupal\color\Plugin\migrate\source\d7 core/modules/color/src/Plugin/migrate/source/d7/Color.php Drupal 7 color source from database.
Color class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Color.php Provides a form element for choosing a color.
Color class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Color.php Performs color conversions. 7
ColorConfigCacheInvalidator class Drupal\color\EventSubscriber core/modules/color/src/EventSubscriber/ColorConfigCacheInvalidator.php A subscriber invalidating cache tags when color config objects are saved. 2
ColorConfigSchemaTest class Drupal\Tests\color\Functional core/modules/color/tests/src/Functional/ColorConfigSchemaTest.php Ensures the color config schema is correct.
ColorLegacyTest class Drupal\Tests\color\Kernel core/modules/color/tests/src/Kernel/ColorLegacyTest.php Tests Color module's legacy code.
ColorSafePreviewTest class Drupal\Tests\color\Functional core/modules/color/tests/src/Functional/ColorSafePreviewTest.php Tests sanitizing color preview loaded from theme.
ColorSystemBrandingBlockAlter class Drupal\color core/modules/color/src/ColorSystemBrandingBlockAlter.php Provides a trusted callback to alter the system branding block. 1
ColorTest class Drupal\Tests\color\Kernel\Plugin\migrate\source\d7 core/modules/color/tests/src/Kernel/Plugin/migrate/source/d7/ColorTest.php Tests D7 color source plugin.
ColorTest class Drupal\Tests\color\Functional core/modules/color/tests/src/Functional/ColorTest.php Modify the Bartik theme colors and make sure the changes are reflected on the frontend.
ColorTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/ColorTest.php Tests Color utility class conversions.
Com class Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/Com.php Generates a UUID using the Windows internal GUID extension. 1
Combine class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/Combine.php Filter handler which allows to search on multiple fields.
CommandInterface interface Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/CommandInterface.php AJAX command interface. 29 11
CommandLineOrUnsafeMethod class Drupal\Core\PageCache\RequestPolicy core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php Reject when running from the command line or when HTTP method is not safe. 2
CommandLineOrUnsafeMethodTest class Drupal\Tests\Core\PageCache core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php @coversDefaultClass \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod @group PageCache
CommandProvider class Drupal\Composer\Plugin\Scaffold composer/Plugin/Scaffold/CommandProvider.php List of all commands provided by this package. 1
CommandsTest class Drupal\KernelTests\Core\Ajax core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php Performs tests on AJAX framework commands.
CommandsTest class Drupal\FunctionalJavascriptTests\Ajax core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php Performs tests on AJAX framework commands.
CommandWithAttachedAssetsInterface interface Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsInterface.php Interface for Ajax commands that render content and attach assets. 4
CommandWithAttachedAssetsTrait trait Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php Trait for Ajax commands that render content and attach assets.
Comment class Drupal\comment\Entity core/modules/comment/src/Entity/Comment.php Defines the comment entity class. 61
Comment class Drupal\comment\Plugin\views\wizard core/modules/comment/src/Plugin/views/wizard/Comment.php Tests creating comment views with the wizard.
Comment class Drupal\comment\Plugin\migrate\source\d6 core/modules/comment/src/Plugin/migrate/source/d6/Comment.php Drupal 6 comment source from database.
Comment class Drupal\comment\Plugin\migrate\source\d7 core/modules/comment/src/Plugin/migrate/source/d7/Comment.php Drupal 7 comment source from database.
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\Functional core/modules/comment/tests/src/Functional/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.
CommentAdminViewUpdateTest class Drupal\Tests\comment\Functional\Update core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php Tests that comment admin view is enabled after update.
CommentAnonymousTest class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentAnonymousTest.php Tests anonymous commenting.
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.

Other projects


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