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
LonelyMonkeyController class Drupal\error_service_test\Controller core/modules/system/tests/modules/error_service_test/src/Controller/LonelyMonkeyController.php Provides a controller which calls out to a service with missing dependencies.
LruCacheGenericTest class Drupal\KernelTests\Core\Cache core/tests/Drupal/KernelTests/Core/Cache/LruCacheGenericTest.php Unit test of the LRU memory cache using the generic cache unit test base.
LruMemoryCache class Drupal\Core\Cache\MemoryCache core/lib/Drupal/Core/Cache/MemoryCache/LruMemoryCache.php Defines a least recently used (LRU) static cache implementation. 2 2
LruMemoryCacheTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/LruMemoryCacheTest.php Tests Drupal\Core\Cache\MemoryCache\LruMemoryCache.
MachineName class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/MachineName.php Provides a machine name render element. 2
MachineName class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/MachineName.php Creates a machine name. 1
MachineName class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/MachineName.php Field handler which allows to show machine name content as human name.
MachineNameTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/MachineNameTest.php Tests the machine name process plugin.
MachineNameTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php Tests Drupal\Core\Render\Element\MachineName.
MachineNameTest class Drupal\KernelTests\Core\Render\Element core/tests/Drupal/KernelTests/Core/Render/Element/MachineNameTest.php Tests Drupal\Core\Render\Element\MachineName.
MachineNameTest class Drupal\FunctionalJavascriptTests\Core core/tests/Drupal/FunctionalJavascriptTests/Core/MachineNameTest.php Tests for the machine name field.
MachineNameTransliterationTest class Drupal\FunctionalJavascriptTests\MachineName core/tests/Drupal/FunctionalJavascriptTests/MachineName/MachineNameTransliterationTest.php Tests the machine name transliteration functionality.
Mail class Drupal\Core\Mail\Attribute core/lib/Drupal/Core/Mail/Attribute/Mail.php Defines a Mail attribute for plugin discovery. 6
Mail class Drupal\Core\Annotation core/lib/Drupal/Core/Annotation/Mail.php Defines a Mail annotation object.
MailCancelTestHooks class Drupal\mail_cancel_test\Hook core/modules/system/tests/modules/mail_cancel_test/src/Hook/MailCancelTestHooks.php Hook implementations for mail_cancel_test.
MailCaptureTest class Drupal\FunctionalTests core/tests/Drupal/FunctionalTests/MailCaptureTest.php Tests the collection of emails during testing.
MailerCaptureServiceProvider class Drupal\mailer_capture core/modules/mailer/tests/modules/mailer_capture/src/MailerCaptureServiceProvider.php Enforce mailer transport which captures sent messages in a key value store.
MailerCaptureTest class Drupal\Tests\mailer\Functional core/modules/mailer/tests/src/Functional/MailerCaptureTest.php Tests capturing of emails when mailer_capture module is installed.
MailerCaptureTestForm class Drupal\mailer_capture_test\Form core/modules/mailer/tests/modules/mailer_capture_test/src/Form/MailerCaptureTestForm.php Mailer capture test form. 1
MailerCaptureTrait trait Drupal\Core\Test core/lib/Drupal/Core/Test/MailerCaptureTrait.php Provides methods for testing emails sent during test runs. 1
MailerDsnConfigValidationTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/MailerDsnConfigValidationTest.php Tests validation of mailer dsn config.
MailerHooks class Drupal\mailer\Hook core/modules/mailer/src/Hook/MailerHooks.php Hook implementations for mailer.
MailFormatHelper class Drupal\Core\Mail core/lib/Drupal/Core/Mail/MailFormatHelper.php Defines a class containing utility methods for formatting mail messages. 8
MailFormatHelperTest class Drupal\Tests\Core\Mail core/tests/Drupal/Tests/Core/Mail/MailFormatHelperTest.php Tests Drupal\Core\Mail\MailFormatHelper.
MailHandler class Drupal\contact core/modules/contact/src/MailHandler.php Provides a class for handling assembly and dispatch of contact mail messages. 1 2
MailHandlerException class Drupal\contact core/modules/contact/src/MailHandlerException.php Exception thrown by MailHandler when unable to determine message recipient. 1
MailHandlerInterface interface Drupal\contact core/modules/contact/src/MailHandlerInterface.php Provides an interface for assembly and dispatch of contact mail messages. 1
MailHandlerTest class Drupal\Tests\contact\Unit core/modules/contact/tests/src/Unit/MailHandlerTest.php Tests Drupal\contact\MailHandler.
MailHtmlTestHooks class Drupal\mail_html_test\Hook core/modules/system/tests/modules/mail_html_test/src/Hook/MailHtmlTestHooks.php Hook implementations for mail_html_test.
MailInterface interface Drupal\Core\Mail core/lib/Drupal/Core/Mail/MailInterface.php Defines an interface for pluggable mail back-ends. 4 4 1
MailManager class Drupal\Core\Mail core/lib/Drupal/Core/Mail/MailManager.php Provides a Mail plugin manager. 1 1 2
MailManagerInterface interface Drupal\Core\Mail core/lib/Drupal/Core/Mail/MailManagerInterface.php Provides an interface for sending mail. 1 2
MailManagerTest class Drupal\Tests\Core\Mail core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php Tests Drupal\Core\Mail\MailManager.
MailTest class Drupal\Tests\system\Kernel\Mail core/modules/system/tests/src/Kernel/Mail/MailTest.php Performs tests on the pluggable mailing framework.
MailToFormatter class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/MailToFormatter.php Plugin implementation of the 'email_mailto' formatter.
MainContentBlockPluginInterface interface Drupal\Core\Block core/lib/Drupal/Core/Block/MainContentBlockPluginInterface.php The interface for "main page content" blocks. 2 5
MainContentFallbackTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php Test SimplePageVariant main content rendering fallback page display variant.
MainContentRendererInterface interface Drupal\Core\Render\MainContent core/lib/Drupal/Core/Render/MainContent/MainContentRendererInterface.php The interface for "main content" ( 5 4
MainContentRenderersPass class Drupal\Core\Render\MainContent core/lib/Drupal/Core/Render/MainContent/MainContentRenderersPass.php Adds main_content_renderers parameter to the container.
MainContentViewSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php View subscriber rendering main content render arrays into responses. 28 2
MaintenanceMode class Drupal\Core\Site core/lib/Drupal/Core/Site/MaintenanceMode.php Provides the default implementation of the maintenance mode service. 2
MaintenanceModeEvents final class Drupal\Core\Site core/lib/Drupal/Core/Site/MaintenanceModeEvents.php Defines events for maintenance mode. 3
MaintenanceModeInterface interface Drupal\Core\Site core/lib/Drupal/Core/Site/MaintenanceModeInterface.php Defines the interface for the maintenance mode service. 1 3
MaintenanceModeSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php Maintenance mode subscriber for controller requests. 2
MaintenanceModeSubscriber class Drupal\user\EventSubscriber core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php Maintenance mode subscriber to log out users. 2
MaintenanceThemeTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php Tests themes and base themes are correctly loaded.
MaintenanceThemeUpdateRegistryTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/MaintenanceThemeUpdateRegistryTest.php Ensures theme update functions are registered for maintenance themes.
MakeUniqueBase abstract class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/MakeUniqueBase.php This plugin ensures the source value is unique. 1
MakeUniqueEntityField class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/MakeUniqueEntityField.php Ensures the source value is made unique against an entity field. 1
MakeUniqueEntityFieldTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php Tests Drupal\migrate\Plugin\migrate\process\MakeUniqueEntityField.

Other projects


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