Classes, traits, and interfaces - 10.3.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 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
HtmlResponseSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php Response subscriber to handle HTML responses. 2
HTMLRestrictions final class Drupal\ckeditor5 core/modules/ckeditor5/src/HTMLRestrictions.php Represents a set of HTML restrictions. 26
HTMLRestrictionsTest class Drupal\Tests\ckeditor5\Unit core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php @coversDefaultClass \Drupal\ckeditor5\HTMLRestrictions[[api-linebreak]] @group ckeditor5
HtmlSerializerRules class Drupal\Component\Utility core/lib/Drupal/Component/Utility/HtmlSerializerRules.php Drupal-specific HTML5 serializer rules.
HtmlTag class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/HtmlTag.php Provides a render element for any HTML tag, with properties and value. 1
HtmlTagTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php @coversDefaultClass \Drupal\Core\Render\Element\HtmlTag[[api-linebreak]] @group Render
HtmlTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/HtmlTest.php Tests \Drupal\Component\Utility\Html.
HtmlTestMarkup class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/HtmlTest.php Marks an object's __toString() method as returning markup.
HtmlToTextTest class Drupal\Tests\system\Unit\Mail core/modules/system/tests/src/Unit/Mail/HtmlToTextTest.php Tests for \Drupal\Core\Mail\MailFormatHelper::htmlToText().
HtRouterTest class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php @coversDefaultClass \Drupal\BuildTests\Framework\BuildTestBase[[api-linebreak]] @group Build @requires extension pdo_sqlite
Http4xxController class Drupal\system\Controller core/modules/system/src/Controller/Http4xxController.php Controller for default HTTP 4xx responses.
HttpExceptionNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/HttpExceptionNormalizer.php Normalizes an HttpException in compliance with the JSON:API specification. 2 4 2
HttpExceptionNormalizerTest class Drupal\Tests\jsonapi\Unit\Normalizer core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php @coversDefaultClass \Drupal\jsonapi\Normalizer\HttpExceptionNormalizer[[api-linebreak]] @group jsonapi
HttpExceptionNormalizerValue class Drupal\jsonapi\Normalizer\Value core/modules/jsonapi/src/Normalizer/Value/HttpExceptionNormalizerValue.php Helps normalize exceptions in compliance with the JSON:API spec. 1
HttpExceptionSubscriberBase abstract class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php Utility base class for exception subscribers. 5 1
HTTPStatusCode class Drupal\views\Plugin\views\area core/modules/views/src/Plugin/views/area/HTTPStatusCode.php Alter the HTTP response status code used by the view.
HWLDFWordAccumulator class Drupal\Component\Diff\Engine core/lib/Drupal/Component/Diff/Engine/HWLDFWordAccumulator.php @todo document @private @subpackage DifferenceEngine 2
HWLDFWordAccumulatorTest class Drupal\Tests\Component\Diff\Engine core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php Test HWLDFWordAccumulator.
I18nQueryTrait trait Drupal\content_translation\Plugin\migrate\source core/modules/content_translation/src/Plugin/migrate/source/I18nQueryTrait.php Gets an i18n translation from the source database. 4
IconBuilderInterface interface Drupal\Core\Layout\Icon core/lib/Drupal/Core/Layout/Icon/IconBuilderInterface.php Provides an interface for building layout icons. 1
IconBuilderTest class Drupal\KernelTests\Core\Layout core/tests/Drupal/KernelTests/Core/Layout/IconBuilderTest.php @coversDefaultClass \Drupal\Core\Layout\Icon\SvgIconBuilder[[api-linebreak]] @group Layout
IconMimeTypes final class Drupal\file core/modules/file/src/IconMimeTypes.php A utility class for working with MIME types. 1
IdAuditor class Drupal\migrate\Audit core/modules/migrate/src/Audit/IdAuditor.php Audits migrations that create content entities in the destination system. 3
IdConflictForm class Drupal\migrate_drupal_ui\Form core/modules/migrate_drupal_ui/src/Form/IdConflictForm.php Migrate Upgrade Id Conflict form. 1
IdConflictTest class Drupal\Tests\migrate_drupal_ui\Functional\d6 core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php Tests Drupal 6 Id Conflict page.
IdConflictTest class Drupal\Tests\migrate_drupal_ui\Functional\d7 core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php Tests Drupal 7 Id Conflict page.
IdMapTableNoDummyTest class Drupal\Tests\migrate_drupal\Kernel core/modules/migrate_drupal/tests/src/Kernel/IdMapTableNoDummyTest.php Test that no dummy migrate_map tables are created.
IFrameMarkup class Drupal\media core/modules/media/src/IFrameMarkup.php Defines an object that wraps oEmbed markup for use in an iFrame. 1
IFrameUrlHelper class Drupal\media core/modules/media/src/IFrameUrlHelper.php Providers helper functions for displaying oEmbed resources in an iFrame. 5 2
IFrameUrlHelperTest class Drupal\Tests\media\Unit core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php @coversDefaultClass \Drupal\media\IFrameUrlHelper[[api-linebreak]]
Ignore class Drupal\Core\Config\Schema core/lib/Drupal/Core/Config/Schema/Ignore.php Configuration property to ignore. 2 1
IgnoredWorkspaceHandler class Drupal\workspaces\Entity\Handler core/modules/workspaces/src/Entity/Handler/IgnoredWorkspaceHandler.php Defines a handler for entity types that are ignored by workspaces. 5
IHaveRuntimeContexts class Drupal\layout_builder_test\ContextProvider core/modules/layout_builder/tests/modules/layout_builder_test/src/ContextProvider/IHaveRuntimeContexts.php Defines a class for a fake context provider. 2
IHaveRuntimeContexts class Drupal\layout_builder_test\Plugin\Block core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Block/IHaveRuntimeContexts.php Defines a class for a context-aware block.
Image class Drupal\media\Plugin\media\Source core/modules/media/src/Plugin/media/Source/Image.php Image entity media source. 3
Image class Drupal\ckeditor5\Plugin\CKEditor5Plugin core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php CKEditor 5 Image plugin. 1
Image class Drupal\Core\Image core/lib/Drupal/Core/Image/Image.php Defines an image object to represent an image file. 1
Image class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Image.php Provides helpers to operate on images. 2
ImageAdminStylesTest class Drupal\Tests\image\FunctionalJavascript core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php Tests creation, deletion, and editing of image styles and effects.
ImageAdminStylesTest class Drupal\Tests\image\Functional core/modules/image/tests/src/Functional/ImageAdminStylesTest.php Tests creation, deletion, and editing of image styles and effects.
ImageButton class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/ImageButton.php Provides a form element for a submit button with an image.
ImageCacheActions class Drupal\image\Plugin\migrate\process\d6 core/modules/image/src/Plugin/migrate/process/d6/ImageCacheActions.php Defines the image cache actions migrate process plugin.
ImageCachePreset class Drupal\image\Plugin\migrate\source\d6 core/modules/image/src/Plugin/migrate/source/d6/ImageCachePreset.php Drupal 6 imagecache presets source from database.
ImageCachePresetTest class Drupal\Tests\image\Kernel\Plugin\migrate\source\d6 core/modules/image/tests/src/Kernel/Plugin/migrate/source/d6/ImageCachePresetTest.php Tests the d6_imagecache_presets source plugin.
ImageDimensionsTest class Drupal\Tests\image\Functional core/modules/image/tests/src/Functional/ImageDimensionsTest.php Tests that images have correct dimensions when styled.
ImageEffect class Drupal\image\Attribute core/modules/image/src/Attribute/ImageEffect.php Defines an ImageEffect attribute for plugin discovery. 11
ImageEffect class Drupal\image\Annotation core/modules/image/src/Annotation/ImageEffect.php Defines an image effect annotation object.
ImageEffectAddForm class Drupal\image\Form core/modules/image/src/Form/ImageEffectAddForm.php Provides an add form for image effects. 1
ImageEffectBase abstract class Drupal\image core/modules/image/src/ImageEffectBase.php Provides a base class for image effects. 4 4
ImageEffectDeleteForm class Drupal\image\Form core/modules/image/src/Form/ImageEffectDeleteForm.php Form for deleting an image effect. 1

Other projects


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