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
ExcludedModulesEventSubscriberTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/ExcludedModulesEventSubscriberTest.php Tests ExcludedModulesEventSubscriber.
ExecTrait trait Drupal\Tests\Composer\Plugin\Scaffold core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php Convenience class for creating fixtures. 3
ExecutableException class Drupal\Core\Executable core/lib/Drupal/Core/Executable/ExecutableException.php Generic executable plugin exception class. 1
ExecutableInterface interface Drupal\Core\Executable core/lib/Drupal/Core/Executable/ExecutableInterface.php An interface for executable plugins. 3 3
ExecutableManagerInterface interface Drupal\Core\Executable core/lib/Drupal/Core/Executable/ExecutableManagerInterface.php An interface for managers of executable plugins. 1 4
ExecutablePluginBase abstract class Drupal\Core\Executable core/lib/Drupal/Core/Executable/ExecutablePluginBase.php Provides the basic architecture for executable plugins. 1 1
ExecuteMigration class Drupal\migrate_no_migrate_drupal_test\Controller core/modules/migrate/tests/modules/migrate_no_migrate_drupal_test/src/Controller/ExecuteMigration.php Custom controller to execute the test migrations.
ExecutionContext class Drupal\Core\TypedData\Validation core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php Defines an execution context class.
ExecutionContextFactory class Drupal\Core\TypedData\Validation core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php Defines an execution factory for the Typed Data validator. 2
ExpectDeprecationTest class Drupal\Tests core/tests/Drupal/Tests/ExpectDeprecationTest.php @coversDefaultClass \Drupal\Tests\Traits\ExpectDeprecationTrait
ExpectDeprecationTrait trait Drupal\Tests\Traits core/tests/Drupal/Tests/Traits/ExpectDeprecationTrait.php Adds the ability to dynamically set expected deprecation messages in tests. 14
ExperimentalHelpTest class Drupal\Tests\help\Functional core/modules/help/tests/src/Functional/ExperimentalHelpTest.php Verifies help for experimental modules.
ExperimentalModuleTest class Drupal\Tests\system\Functional\Module core/modules/system/tests/src/Functional/Module/ExperimentalModuleTest.php Tests the installation of modules.
ExperimentalThemeTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/ExperimentalThemeTest.php Tests the installation of themes.
Explode class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/Explode.php Splits the source string into an array of strings, using a delimiter. 1
ExplodeTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/ExplodeTest.php Tests the Explode process plugin.
ExportForm class Drupal\locale\Form core/modules/locale/src/Form/ExportForm.php Form for the Gettext translation files export form. 1
ExportStorageManager final class Drupal\Core\Config core/lib/Drupal/Core/Config/ExportStorageManager.php The export storage manager dispatches an event for the export storage. 1 2
ExportStorageManagerTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/ExportStorageManagerTest.php Tests the export storage manager.
ExposedFilterAJAXTest class Drupal\Tests\views\FunctionalJavascript core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php Tests the basic AJAX functionality of Views exposed forms.
ExposedFilterBlocksUpdateTest class Drupal\Tests\views\Functional\Update core/modules/views/tests/src/Functional/Update/ExposedFilterBlocksUpdateTest.php Tests that the additional settings are added to the entity link field.
ExposedFormCache class Drupal\views core/modules/views/src/ExposedFormCache.php Caches exposed forms, as they are heavy to generate. 1 2
ExposedFormCheckboxesTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php Tests exposed forms functionality.
ExposedFormPluginBase abstract class Drupal\views\Plugin\views\exposed_form core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php Base class for Views exposed filter form plugins. 2
ExposedFormPluginInterface interface Drupal\views\Plugin\views\exposed_form core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginInterface.php Interface for exposed filter form plugins. 1 1
ExposedFormRenderTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php Tests the exposed form.
ExposedFormTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php Tests exposed forms functionality.
ExposedFormUITest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php Tests exposed forms UI functionality.
ExtendableInterface interface Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/ExtendableInterface.php Interface for extendable query objects. 1
ExtendingNonInstalledClass class Drupal\plugin_test\Plugin\plugin_test\fruit core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/ExtendingNonInstalledClass.php Plugin annotation @Plugin( id = "extending_non_installed_class", label = "A plugin whose class is extending from a non-installed module class", color = "pink", )
Extension class Drupal\system\Plugin\migrate\source core/modules/system/src/Plugin/migrate/source/Extension.php Gets system data for a legacy extension.
Extension class Drupal\Core\Extension core/lib/Drupal/Core/Extension/Extension.php Defines an extension (file) object. 39
ExtensionDiscovery class Drupal\Core\Extension core/lib/Drupal/Core/Extension/ExtensionDiscovery.php Discovers available extensions in the filesystem. 22
ExtensionDiscoveryTest class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/ExtensionDiscoveryTest.php Tests discovery of extensions.
ExtensionInstallStorage class Drupal\Core\Config core/lib/Drupal/Core/Config/ExtensionInstallStorage.php Storage to access configuration and schema in enabled extensions. 1 2 2
ExtensionInstallStorageTest class Drupal\Tests\Core\Config core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php Tests the Config.
ExtensionList abstract class Drupal\Core\Extension core/lib/Drupal/Core/Extension/ExtensionList.php Provides available extensions. 5 1
ExtensionListTest class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php @coversDefaultClass \Drupal\Core\Extension\ExtensionList @group Extension
ExtensionListTrait trait Drupal\Core\Installer core/lib/Drupal/Core/Installer/ExtensionListTrait.php Provides common functionality for the extension list classes.
ExtensionMimeTypeGuesser class Drupal\Core\File\MimeType core/lib/Drupal/Core/File/MimeType/ExtensionMimeTypeGuesser.php Makes possible to guess the MIME type of a file using its extension. 2
ExtensionMimeTypeGuesser class Drupal\Core\ProxyClass\File\MimeType core/lib/Drupal/Core/ProxyClass/File/MimeType/ExtensionMimeTypeGuesser.php Provides a proxy class for \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser.
ExtensionNameLengthException class Drupal\Core\Extension core/lib/Drupal/Core/Extension/ExtensionNameLengthException.php Exception thrown when the extension's name length exceeds the allowed maximum. 2
ExtensionSerializationTest class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php Tests Extension serialization.
ExtensionTest class Drupal\Tests\system\Kernel\Plugin\migrate\source core/modules/system/tests/src/Kernel/Plugin/migrate/source/ExtensionTest.php Tests legacy extension source plugin.
ExtensionViewsFieldTest class Drupal\Tests\file\Kernel\Views core/modules/file/tests/src/Kernel/Views/ExtensionViewsFieldTest.php Tests the core Drupal\file\Plugin\views\field\Extension handler.
ExternalCommandRequirementsTrait trait Drupal\BuildTests\Framework core/tests/Drupal/BuildTests/Framework/ExternalCommandRequirementsTrait.php Allows test classes to require external command line applications. 1
ExternalCommandRequirementTest class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/ExternalCommandRequirementTest.php @coversDefaultClass \Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait @group Build
ExternalFormUrlTest class Drupal\KernelTests\Core\Form core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php Ensures that form actions can't be tricked into sending to external URLs.
ExternalNormalizersTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php Asserts external normalizers are handled as expected by the JSON:API module.
Extract class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/Extract.php Extracts a value from an array. 1

Other projects


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