Classes, traits, and interfaces - 9.5.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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
EditorManagerTest class Drupal\Tests\editor\Kernel core/modules/editor/tests/src/Kernel/EditorManagerTest.php Tests detection of text editors and correct generation of attachments.
EditorPluginInterface interface Drupal\editor\Plugin core/modules/editor/src/Plugin/EditorPluginInterface.php Defines an interface for configurable text editors. 1
EditorPrivateFileReferenceFilterTest class Drupal\Tests\editor\Functional core/modules/editor/tests/src/Functional/EditorPrivateFileReferenceFilterTest.php Tests Editor module's file reference filter with private files.
EditorResourceTestBase abstract class Drupal\Tests\editor\Functional\Rest core/modules/editor/tests/src/Functional/Rest/EditorResourceTestBase.php ResourceTestBase for Editor entity. 9 3
EditorSecurityTest class Drupal\Tests\editor\Functional core/modules/editor/tests/src/Functional/EditorSecurityTest.php Tests XSS protection for content creators when using text editors.
EditorSelectionTest class Drupal\Tests\quickedit\Kernel core/modules/quickedit/tests/src/Kernel/EditorSelectionTest.php Tests in-place field editor selection.
EditorSelector class Drupal\quickedit core/modules/quickedit/src/EditorSelector.php Selects an in-place editor (an InPlaceEditor plugin) for a field. 2 2
EditorSelectorInterface interface Drupal\quickedit core/modules/quickedit/src/EditorSelectorInterface.php Interface for selecting an in-place editor (an Editor plugin) for a field. 1
EditorTestTextLongItem class Drupal\editor_test\Plugin\Field\FieldType core/modules/editor/tests/modules/editor_test/src/Plugin/Field/FieldType/EditorTestTextLongItem.php Plugin implementation of the 'editor_test_text_long' field type.
EditorUploadImageScaleTest class Drupal\Tests\editor\Functional core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php Tests scaling of inline images.
EditorXmlAnonTest class Drupal\Tests\editor\Functional\Rest core/modules/editor/tests/src/Functional/Rest/EditorXmlAnonTest.php @group rest
EditorXmlBasicAuthTest class Drupal\Tests\editor\Functional\Rest core/modules/editor/tests/src/Functional/Rest/EditorXmlBasicAuthTest.php @group rest
EditorXmlCookieTest class Drupal\Tests\editor\Functional\Rest core/modules/editor/tests/src/Functional/Rest/EditorXmlCookieTest.php @group rest
EditorXssFilterInterface interface Drupal\editor core/modules/editor/src/EditorXssFilterInterface.php Defines an interface for text editor XSS (Cross-site scripting) filters. 2 2
Element class Drupal\editor core/modules/editor/src/Element.php Defines a service for Text Editor's render elements. 2
Element class Drupal\Core\Render core/lib/Drupal/Core/Render/Element.php Provides helper methods for Drupal render elements. 108
Element abstract class Drupal\Core\Config\Schema core/lib/Drupal/Core/Config/Schema/Element.php Defines a generic configuration element. 3
ElementInfoIntegrationTest class Drupal\KernelTests\Core\Render core/tests/Drupal/KernelTests/Core/Render/ElementInfoIntegrationTest.php Tests the element info.
ElementInfoManager class Drupal\Core\Render core/lib/Drupal/Core/Render/ElementInfoManager.php Provides a plugin manager for element plugins. 1 1 2
ElementInfoManagerInterface interface Drupal\Core\Render core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php Collects available render array element types. 1 6
ElementInfoManagerTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php @coversDefaultClass \Drupal\Core\Render\ElementInfoManager[[api-linebreak]] @group Render
ElementInterface interface Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/ElementInterface.php Provides an interface for render element plugins. 2
ElementsAccessTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php Tests access control for form elements.
ElementsContainerTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php Tests the container form element for expected behavior.
ElementsFieldsetTest class Drupal\Tests\system\Kernel\Form core/modules/system/tests/src/Kernel/Form/ElementsFieldsetTest.php Tests fieldset element rendering and description placement.
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.
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 @coversDefaultClass \Drupal\Core\Render\Element[[api-linebreak]] @group Render
ElementValidationTest class Drupal\FunctionalJavascriptTests\Ajax core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php Various tests of AJAX behavior.
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\Core\TypedData\Plugin\DataType core/lib/Drupal/Core/TypedData/Plugin/DataType/Email.php The Email data type. 1
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.
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.
EmailItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php Defines the 'email' field type. 1
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 4
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
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. 1
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. 1 1
EmptyStatementTest class Drupal\Tests\Core\Database core/tests/Drupal/Tests/Core/Database/EmptyStatementTest.php Tests the empty pseudo-statement class.
EndOfTransactionQueriesTest class Drupal\KernelTests\Core\Cache core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php Tests that cache tag invalidation queries are delayed to the end of transactions.

Other projects


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