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
CheckProviderInterface interface Drupal\Core\Access core/lib/Drupal/Core/Access/CheckProviderInterface.php Provides the available access checkers by service IDs. 1 1
CheckRequirementsTest class Drupal\Tests\migrate\Unit\Plugin\migrate\destination core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php Tests check requirements exception on DestinationBase.
Cherry class Drupal\plugin_test\Plugin\plugin_test\fruit core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/Cherry.php Plugin annotation @Plugin( id = "cherry", label = "Cherry", color = "red" )
ChmodInterface interface Drupal\Core\FileTransfer core/lib/Drupal/Core/FileTransfer/ChmodInterface.php Defines an interface to chmod files. 3
ChooseBlockController class Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/ChooseBlockController.php Defines a controller to choose a new block.
ChooseSectionController class Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/ChooseSectionController.php Defines a controller to choose a new section.
CKEditor class Drupal\ckeditor\Plugin\Editor core/modules/ckeditor/src/Plugin/Editor/CKEditor.php Defines a CKEditor-based text editor for Drupal. 1
CKEditorAdminSortTrait trait Drupal\Tests\ckeditor\Traits core/modules/ckeditor/tests/src/Traits/CKEditorAdminSortTrait.php Provides callback for simulated CKEditor toolbar configuration change. 1
CKEditorAdminTest class Drupal\Tests\ckeditor\Functional core/modules/ckeditor/tests/src/Functional/CKEditorAdminTest.php Tests administration of CKEditor.
CKEditorIntegrationTest class Drupal\Tests\ckeditor\FunctionalJavascript core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php Tests the integration of CKEditor.
CKEditorIntegrationTest class Drupal\Tests\media_library\FunctionalJavascript core/modules/media_library/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php @coversDefaultClass \Drupal\media_library\Plugin\CKEditorPlugin\DrupalMediaLibrary @group media_library
CKEditorIntegrationTest class Drupal\Tests\media\FunctionalJavascript core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php @coversDefaultClass \Drupal\media\Plugin\CKEditorPlugin\DrupalMedia @group media
CKEditorLoadingTest class Drupal\Tests\ckeditor\Functional core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php Tests loading of CKEditor.
CkeditorOffCanvasTestController class Drupal\ckeditor_test core/modules/ckeditor/tests/modules/src/CkeditorOffCanvasTestController.php Provides controller for testing CKEditor in off-canvas dialogs.
CKEditorPlugin class Drupal\ckeditor\Annotation core/modules/ckeditor/src/Annotation/CKEditorPlugin.php Defines a CKEditorPlugin annotation object.
CKEditorPluginBase abstract class Drupal\ckeditor core/modules/ckeditor/src/CKEditorPluginBase.php Defines a base CKEditor plugin implementation. 6 6
CKEditorPluginButtonsInterface interface Drupal\ckeditor core/modules/ckeditor/src/CKEditorPluginButtonsInterface.php Defines an interface for CKEditor plugins with buttons. 4 3
CKEditorPluginConfigurableInterface interface Drupal\ckeditor core/modules/ckeditor/src/CKEditorPluginConfigurableInterface.php Defines an interface for configurable CKEditor plugins. 4 4
CKEditorPluginContextualInterface interface Drupal\ckeditor core/modules/ckeditor/src/CKEditorPluginContextualInterface.php Defines an interface for contextually enabled CKEditor plugins. 5 5
CKEditorPluginCssInterface interface Drupal\ckeditor core/modules/ckeditor/src/CKEditorPluginCssInterface.php Defines an interface for CKEditor plugins with associated CSS. 4 4
CKEditorPluginInterface interface Drupal\ckeditor core/modules/ckeditor/src/CKEditorPluginInterface.php Defines an interface for (loading of) CKEditor plugins. 7 2
CKEditorPluginManager class Drupal\ckeditor core/modules/ckeditor/src/CKEditorPluginManager.php Provides a CKEditor Plugin plugin manager. 3 2
CKEditorPluginManagerTest class Drupal\Tests\ckeditor\Unit core/modules/ckeditor/tests/src/Unit/CKEditorPluginManagerTest.php @coversDefaultClass \Drupal\ckeditor\CKEditorPluginManager
CKEditorPluginManagerTest class Drupal\Tests\ckeditor\Kernel core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php Tests different ways of enabling CKEditor plugins.
CKEditorStylesComboAdminTest class Drupal\Tests\ckeditor\Functional core/modules/ckeditor/tests/src/Functional/CKEditorStylesComboAdminTest.php Tests administration of the CKEditor StylesCombo plugin.
CKEditorStylesComboTranslationTest class Drupal\Tests\ckeditor\Functional core/modules/ckeditor/tests/src/Functional/CKEditorStylesComboTranslationTest.php Tests administration of the CKEditor StylesCombo plugin.
CKEditorTest class Drupal\Tests\ckeditor\Kernel core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php Tests for the 'CKEditor' text editor plugin.
CKEditorTestTrait trait Drupal\Tests\ckeditor\Traits core/modules/ckeditor/tests/src/Traits/CKEditorTestTrait.php Provides methods to test CKEditor. 3
CKEditorToolbarButtonTest class Drupal\Tests\ckeditor\Functional core/modules/ckeditor/tests/src/Functional/CKEditorToolbarButtonTest.php Tests CKEditor toolbar buttons when the language direction is RTL.
ClaroBlockFilterTest class Drupal\FunctionalJavascriptTests\Theme core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroBlockFilterTest.php Runs BlockFilterTest in Claro.
ClaroEntityDisplayTest class Drupal\FunctionalJavascriptTests\Theme core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php Runs EntityDisplayTest in Claro.
ClaroLayoutBuilderTest class Drupal\FunctionalTests\Theme core/tests/Drupal/FunctionalTests/Theme/ClaroLayoutBuilderTest.php Tests the layout builder with the Claro theme.
ClaroMenuUiJavascriptTest class Drupal\FunctionalJavascriptTests\Theme core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroMenuUiJavascriptTest.php Runs MenuUiJavascriptTest in Claro.
ClaroPreRender class Drupal\claro core/themes/claro/src/ClaroPreRender.php Implements trusted prerender callbacks for the Claro theme. 1
ClaroTableDragTest class Drupal\FunctionalJavascriptTests\Theme core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroTableDragTest.php Runs TableDragTest in Claro.
ClaroTest class Drupal\FunctionalTests\Theme core/tests/Drupal/FunctionalTests/Theme/ClaroTest.php Tests the Claro theme.
ClaroViewsUiTest class Drupal\FunctionalJavascriptTests\Theme core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php Runs tests on Views UI using Claro.
ClassFinder class Drupal\Component\ClassFinder core/lib/Drupal/Component/ClassFinder/ClassFinder.php A Utility class that uses active autoloaders to find a file for a class. 2
ClassFinderTest class Drupal\Tests\Component\ClassFinder core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php @coversDefaultClass \Drupal\Component\ClassFinder\ClassFinder @group ClassFinder
ClassLoaderTest class Drupal\Tests\Core\ClassLoader core/tests/Drupal/Tests/Core/ClassLoader/ClassLoaderTest.php @group ClassLoader @group legacy @runTestsInSeparateProcesses
ClassLoaderTest class Drupal\Tests\system\Functional\Module core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php Tests class loading for modules.
ClassRequiresAvailable class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/ExternalCommandRequirementTest.php @requires externalCommand available_command
ClassRequiresUnavailable class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/ExternalCommandRequirementTest.php @requires externalCommand unavailable_command
ClassResolver class Drupal\Core\DependencyInjection core/lib/Drupal/Core/DependencyInjection/ClassResolver.php Implements the class resolver interface supporting class names and services. 2 2
ClassResolverInterface interface Drupal\Core\DependencyInjection core/lib/Drupal/Core/DependencyInjection/ClassResolverInterface.php Provides an interface to get a instance of a class with dependency injection. 1 21
ClassWithConstants class Drupal\Tests\Component\Annotation\Doctrine\Fixtures core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/ClassWithConstants.php 1
ClassWithInvalidAnnotationTargetAtClass class Drupal\Tests\Component\Annotation\Doctrine\Fixtures core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/ClassWithInvalidAnnotationTargetAtClass.php Plugin annotation @AnnotationTargetPropertyMethod("Some data");
ClassWithInvalidAnnotationTargetAtMethod class Drupal\Tests\Component\Annotation\Doctrine\Fixtures core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/ClassWithInvalidAnnotationTargetAtMethod.php Plugin annotation @AnnotationTargetClass("Some data");
ClassWithInvalidAnnotationTargetAtProperty class Drupal\Tests\Component\Annotation\Doctrine\Fixtures core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/ClassWithInvalidAnnotationTargetAtProperty.php Plugin annotation @AnnotationTargetClass("Some data");
ClassWithValidAnnotationTarget class Drupal\Tests\Component\Annotation\Doctrine\Fixtures core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/ClassWithValidAnnotationTarget.php Plugin annotation @AnnotationTargetClass("Some data");

Other projects


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