Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
HelpTopicTranslationTest class Drupal\Tests\help\Functional core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php Verifies help topic translations.
HelpTopicTwig class Drupal\help core/modules/help/src/HelpTopicTwig.php Represents a help topic plugin whose definition comes from a Twig file. 2
HelpTopicTwigLoader class Drupal\help core/modules/help/src/HelpTopicTwigLoader.php Loads help topic Twig files from the filesystem. 1 2
HelpTopicTwigLoaderTest class Drupal\Tests\help\Unit core/modules/help/tests/src/Unit/HelpTopicTwigLoaderTest.php Unit test for the HelpTopicTwigLoader class.
HelpTopicTwigTest class Drupal\Tests\help\Unit core/modules/help/tests/src/Unit/HelpTopicTwigTest.php Unit test for the HelpTopicTwig class.
HelpTwigExtension class Drupal\help core/modules/help/src/HelpTwigExtension.php Defines and registers Drupal Twig extensions for rendering help topics. 2
HexToHslTrait trait Drupal\olivero core/themes/olivero/src/HexToHslTrait.php Trait to convert Hex to HSL. 2
Hidden class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Hidden.php Provides a form element for an HTML 'hidden' input element. 1
HiddenFieldSelector class Drupal\Tests core/tests/Drupal/Tests/HiddenFieldSelector.php Extends PartialNamedSelector to allow retrieval of hidden fields.
HiddenTaxonomyTermReferenceFieldWizardTest class Drupal\Tests\node\Functional\Views\Wizard core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php Tests node wizard and content type with hidden Taxonomy Term Reference field.
HiddenTestItem class Drupal\field_test\Plugin\Field\FieldType core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/HiddenTestItem.php Defines the 'hidden_test' entity field item.
HighestIdInterface interface Drupal\migrate\Audit core/modules/migrate/src/Audit/HighestIdInterface.php Defines an interface for destination and ID maps which track a highest ID. 2 2
HighlightCommand class Drupal\views\Ajax core/modules/views/src/Ajax/HighlightCommand.php Provides an AJAX command for highlighting a certain new piece of html. 1
HighPriorityThemeNegotiator class Drupal\theme_test\Theme core/modules/system/tests/modules/theme_test/src/Theme/HighPriorityThemeNegotiator.php Implements a test theme negotiator which was configured with a high priority. 2
HighWaterNotJoinableTest class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/HighWaterNotJoinableTest.php Tests the high water handling.
HighWaterTest class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/HighWaterTest.php Tests migration high water property.
HighWaterTest class Drupal\migrate_high_water_test\Plugin\migrate\source core/modules/migrate/tests/modules/migrate_high_water_test/src/Plugin/migrate/source/HighWaterTest.php Source plugin for migration high water tests. 1
HoldTestHelper class Drupal\hold_test core/modules/system/tests/modules/hold_test/src/HoldTestHelper.php Contains methods for testing hold request/response. 3
HoldTestSubscriber class Drupal\hold_test\EventSubscriber core/modules/system/tests/modules/hold_test/src/EventSubscriber/HoldTestSubscriber.php Response subscriber to test hold. 1 2
Hook class Drupal\Core\Hook\Attribute core/lib/Drupal/Core/Hook/Attribute/Hook.php Attribute for defining a class method as a hook implementation. 469
HookAlterOrderTest class Drupal\KernelTests\Core\Hook core/tests/Drupal/KernelTests/Core/Hook/HookAlterOrderTest.php Tests Hook Alter Order.
HookAttributeInterface interface Drupal\Core\Hook\Attribute core/lib/Drupal/Core/Hook/Attribute/HookAttributeInterface.php Common interface for attributes used for hook discovery. 3 2
HookAttributeInvokeHook class Drupal\hook_collector_hook_attribute\Hook core/modules/system/tests/modules/hook_collector_hook_attribute/src/Hook/HookAttributeInvokeHook.php Test Hook attribute named arguments.
HookAttributeNamedArgumentsHook class Drupal\hook_collector_hook_attribute\Hook core/modules/system/tests/modules/hook_collector_hook_attribute/src/Hook/HookAttributeNamedArgumentsHook.php Test Hook attribute named arguments.
HookCollectorKeyValueWritePass class Drupal\Core\Hook core/lib/Drupal/Core/Hook/HookCollectorKeyValueWritePass.php Stores hook implementations in keyvalue and clears cache. 2
HookCollectorPass class Drupal\Core\Hook core/lib/Drupal/Core/Hook/HookCollectorPass.php Collects and registers hook implementations. 4
HookCollectorPassTest class Drupal\Tests\system\Functional\Hook core/modules/system/tests/src/Functional/Hook/HookCollectorPassTest.php Tests services in .module files.
HookCollectorPassTest class Drupal\KernelTests\Core\Hook core/tests/Drupal/KernelTests/Core/Hook/HookCollectorPassTest.php Tests Drupal\Core\Hook\HookCollectorPass.
HookCollectorPassTest class Drupal\Tests\Core\Hook core/tests/Drupal/Tests/Core/Hook/HookCollectorPassTest.php Tests Drupal\Core\Hook\HookCollectorPass.
HookDiscovery class Drupal\Core\Plugin\Discovery core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php Provides a hook-based plugin discovery class. 1
HookDiscoveryTest class Drupal\Tests\Core\Plugin\Discovery core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php Tests Drupal\Core\Plugin\Discovery\HookDiscovery.
HookHelpSection class Drupal\help\Plugin\HelpSection core/modules/help/src/Plugin/HelpSection/HookHelpSection.php Provides the module topics list section for the help page.
HookLoaderTest class Drupal\KernelTests\Core\Hook core/tests/Drupal/KernelTests/Core/Hook/HookLoaderTest.php Test hook loading.
HookOrderTest class Drupal\KernelTests\Core\Hook core/tests/Drupal/KernelTests/Core/Hook/HookOrderTest.php Tests Hook Order.
HookOrderTestTrait trait Drupal\KernelTests\Core\Hook core/tests/Drupal/KernelTests/Core/Hook/HookOrderTestTrait.php Provides methods to support testing hooks.
HookRequirementsTest class Drupal\Tests\system\Functional\Module core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php Attempts enabling a module that fails hook_requirements('install').
HtaccessTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/HtaccessTest.php Tests .htaccess is working correctly.
HtaccessTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php Tests .htaccess file saving.
HtaccessWriter class Drupal\Core\File core/lib/Drupal/Core/File/HtaccessWriter.php Provides functions to manage Apache .htaccess files. 1 2
HtaccessWriterInterface interface Drupal\Core\File core/lib/Drupal/Core/File/HtaccessWriterInterface.php Interface for managing Apache .htaccess files. 1
Html class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Html.php Provides DOMDocument helpers for parsing and serializing HTML strings. 219
Html class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Html.php Provides a render element for an entire HTML page: <html> plus its children.
HtmlAttributesTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php Tests attributes inserted in the 'html' and 'body' elements on the page.
HtmlCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/HtmlCommand.php AJAX command for calling the jQuery html() method. 7
HtmlEntityFormController class Drupal\Core\Entity core/lib/Drupal/Core/Entity/HtmlEntityFormController.php Wrapping controller for entity forms that serve as the main page body. 2
HtmlEscapedText class Drupal\Component\Render core/lib/Drupal/Component/Render/HtmlEscapedText.php Escapes HTML syntax characters to HTML entities for display in markup. 2
HtmlEscapedTextTest class Drupal\Tests\Component\Render core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php Tests the HtmlEscapedText class.
HtmlFormController class Drupal\Core\Controller core/lib/Drupal/Core/Controller/HtmlFormController.php Wrapping controller for forms that serve as the main page body. 2
HtmlList class Drupal\views\Plugin\views\style core/modules/views/src/Plugin/views/style/HtmlList.php Style plugin to render each item in an ordered or unordered list.
HtmlOutputLogger final class Drupal\TestTools\Extension\HtmlLogging core/tests/Drupal/TestTools/Extension/HtmlLogging/HtmlOutputLogger.php Drupal's extension for providing HTML output results for functional tests. 1

Other projects


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