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
ElementsLabelsTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php Tests form element labels, required markers and associated output.
ElementsTableSelectTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php Tests the tableselect form element for expected behavior.
ElementsTableSelectTest class Drupal\Tests\system\FunctionalJavascript\Form core/modules/system/tests/src/FunctionalJavascript/Form/ElementsTableSelectTest.php Tests the tableselect form element for expected behavior.
ElementsVerticalTabsTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php Tests the vertical_tabs form element for expected behavior.
ElementsVerticalTabsWithSummaryTest class Drupal\Tests\system\FunctionalJavascript\Form core/modules/system/tests/src/FunctionalJavascript/Form/ElementsVerticalTabsWithSummaryTest.php Tests that titles and summaries in vertical-tabs form elements are set correctly.
ElementTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/ElementTest.php Tests building and processing of core form elements.
ElementTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/ElementTest.php Tests Drupal\Core\Render\Element.
ElementValidationTest class Drupal\FunctionalJavascriptTests\Ajax core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php Various tests of AJAX behavior.
Email class Drupal\Core\TypedData\Plugin\DataType core/lib/Drupal/Core/TypedData/Plugin/DataType/Email.php The Email data type. 1 1
Email class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Email.php Provides a form input element for entering an email address. 4
Email class Drupal\field\Plugin\migrate\field core/modules/field/src/Plugin/migrate/field/Email.php MigrateField Plugin for Drupal 6 and 7 email fields.
EmailAction class Drupal\Core\Action\Plugin\Action core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php Sends an email message.
EmailActionTest class Drupal\KernelTests\Core\Action core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php Tests for the EmailAction plugin.
EmailConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php Count constraint. 1
EmailDefaultWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php Plugin implementation of the 'email_default' widget.
EmailFieldTest class Drupal\Tests\field\Functional\Email core/modules/field/tests/src/Functional/Email/EmailFieldTest.php Tests email field functionality.
EmailItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php Defines the 'email' field type. 1
EmailItemTest class Drupal\Tests\field\Kernel\Email core/modules/field/tests/src/Kernel/Email/EmailItemTest.php Tests the new entity API for the email field type.
EmailTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/EmailTest.php Tests the form API email element.
EmailValidator class Drupal\Component\Utility core/lib/Drupal/Component/Utility/EmailValidator.php Validates email addresses. 1 2
EmailValidatorInterface interface Drupal\Component\Utility core/lib/Drupal/Component/Utility/EmailValidatorInterface.php Validates email addresses. 1 3
EmailValidatorTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php Tests the EmailValidator utility class.
Embed class Drupal\views\Plugin\views\display core/modules/views/src/Plugin/views/display/Embed.php The plugin that handles an embed display.
EmbeddedDataSource class Drupal\migrate\Plugin\migrate\source core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php Allows source data to be defined in the configuration of the source plugin. 1 1
EmbeddedFormWidgetTest class Drupal\Tests\media_library\FunctionalJavascript core/modules/media_library/tests/src/FunctionalJavascript/EmbeddedFormWidgetTest.php Tests media widget nested inside another widget.
EmphasisTest class Drupal\Tests\ckeditor5\FunctionalJavascript core/modules/ckeditor5/tests/src/FunctionalJavascript/EmphasisTest.php Tests emphasis in CKEditor 5.
EmptyAccessPolicy class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php A test access policy class that does nothing.
EmptyBlockForm class Drupal\block_test\PluginForm core/modules/block/tests/modules/block_test/src/PluginForm/EmptyBlockForm.php Provides a form for a block that is empty. 2
EmptyHelpSection class Drupal\help_page_test\Plugin\HelpSection core/modules/help/tests/modules/help_page_test/src/Plugin/HelpSection/EmptyHelpSection.php Provides an empty section for the help page, for testing.
EmptySource class Drupal\migrate\Plugin\migrate\source core/modules/migrate/src/Plugin/migrate/source/EmptySource.php Source returning a row based on the constants provided. 2 2
EmptySource class Drupal\migrate_multiple_provider_test\Plugin\migrate\source core/modules/migrate/tests/modules/migrate_multiple_provider_test/src/Plugin/migrate/source/EmptySource.php Source for testing multiple providers. 1 1
EmptySource

in drupal:11.3.0 and is removed from drupal:12.0.0. There is no replacement.

class Drupal\migrate_drupal\Plugin\migrate\source core/modules/migrate_drupal/src/Plugin/migrate/source/EmptySource.php Source returning an empty row with Drupal specific config dependencies.
EnabledConfigurablePluginsConstraint class Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/EnabledConfigurablePluginsConstraint.php The CKEditor 5 plugin settings.
EnabledConfigurablePluginsConstraintValidator class Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/EnabledConfigurablePluginsConstraintValidator.php Enabled configurable plugin settings validator. 1
EnabledExtensionsValidator final class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/EnabledExtensionsValidator.php Validates no enabled Drupal extensions are removed from the stage directory. 1
EnabledExtensionsValidatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/EnabledExtensionsValidatorTest.php Tests Enabled Extensions Validator.
EnableLayoutBuilderTrait trait Drupal\Tests\layout_builder\Traits core/modules/layout_builder/tests/src/Traits/EnableLayoutBuilderTrait.php Test trait to enable or disable Layout Builder on an entity view display. 5
EndOfTransactionQueriesTest class Drupal\KernelTests\Core\Cache core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php Tests delaying of cache tag invalidation queries to the end of transactions.
Endpoint class Drupal\media\OEmbed core/modules/media/src/OEmbed/Endpoint.php Value object for oEmbed provider endpoints. 1
EndpointTest class Drupal\Tests\media\Unit core/modules/media/tests/src/Unit/EndpointTest.php Tests Drupal\media\OEmbed\Endpoint.
EnforcedFormResponseSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/EnforcedFormResponseSubscriber.php Handle the EnforcedResponseException and deliver an EnforcedResponse. 2
EnforcedResponse class Drupal\Core\Form core/lib/Drupal/Core/Form/EnforcedResponse.php A wrapper containing a response which is to be enforced upon delivery. 1
EnforcedResponseException class Drupal\Core\Form core/lib/Drupal/Core/Form/EnforcedResponseException.php Custom exception to break out of the main request and enforce a response. 7
EngineNyanCatTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/EngineNyanCatTest.php Tests the multi theme engine support.
EngineNyanCatTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php Tests the multi theme engine support.
EngineTwigTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php Tests Twig-specific theme functionality.
EnhancerInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/EnhancerInterface.php A route enhance service to determine route enhance rules. 8 8
EnsurePHPStanVersionsMatchTest class Drupal\PHPStan\Tests core/tests/PHPStan/tests/EnsurePHPStanVersionsMatchTest.php Tests that PHPStan version used for rules testing matches core.
EnterProfileNode class Drupal\sdc_other_node_visitor\Twig\Profiler core/modules/system/tests/modules/sdc_other_node_visitor/src/Twig/Profiler/EnterProfileNode.php Represents a profile enter node. 1
Entity abstract class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/Entity.php Provides a generic destination to import entities. 2

Other projects


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