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
LockBackendAbstract abstract class Drupal\Core\Lock core/lib/Drupal/Core/Lock/LockBackendAbstract.php Non backend related common methods implementation for lock backends. 1
LockBackendAbstractTest class Drupal\Tests\Core\Lock core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php @coversDefaultClass \Drupal\Tests\Core\Lock\LockBackendAbstractTest[[api-linebreak]] @group Lock
LockBackendInterface interface Drupal\Core\Lock core/lib/Drupal/Core/Lock/LockBackendInterface.php Lock backend interface. 4 26
LockFunctionalTest class Drupal\Tests\system\Functional\Lock core/modules/system/tests/src/Functional/Lock/LockFunctionalTest.php Confirm locking works between two separate requests.
LockTest class Drupal\KernelTests\Core\Lock core/tests/Drupal/KernelTests/Core/Lock/LockTest.php Tests the Database lock backend.
Log class Drupal\Core\Database core/lib/Drupal/Core/Database/Log.php Database query logger. 4
Log class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/Log.php Logs values without changing them. 1
LoggedStatementsTrait trait Drupal\database_statement_monitoring_test core/modules/system/tests/modules/database_statement_monitoring_test/src/LoggedStatementsTrait.php Trait for Connection classes that can store logged statements. 3
LoggerChannel class Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannel.php Defines a logger channel that most implementations will use. 1 2 5
LoggerChannelFactory class Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelFactory.php Defines a factory for logging channels. 5 2
LoggerChannelFactoryInterface interface Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelFactoryInterface.php Logger channel factory interface. 1 8
LoggerChannelFactoryTest class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php @coversDefaultClass \Drupal\Core\Logger\LoggerChannelFactory[[api-linebreak]] @group Logger
LoggerChannelInterface interface Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelInterface.php Logger channel interface. 1 4
LoggerChannelTest class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php @coversDefaultClass \Drupal\Core\Logger\LoggerChannel[[api-linebreak]] @group Logger
LoggerChannelTrait trait Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelTrait.php Wrapper methods for the logger factory service. 5
LoggingForm class Drupal\system\Form core/modules/system/src/Form/LoggingForm.php Configure logging settings for this site. 2
LoggingTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/LoggingTest.php Tests the query logging facility.
LoginLogoutMenuLink class Drupal\user\Plugin\Menu core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php A menu link that shows "Log in" or "Log out" as appropriate. 1
LoginStatusCheck class Drupal\user\Access core/modules/user/src/Access/LoginStatusCheck.php Determines access to routes based on login status of current user. 2
LogMessageParser class Drupal\Core\Logger core/lib/Drupal/Core/Logger/LogMessageParser.php Parses log messages and their placeholders. 1 2
LogMessageParserInterface interface Drupal\Core\Logger core/lib/Drupal/Core/Logger/LogMessageParserInterface.php Defines an interface for parsing log messages and their placeholders. 1 2
LogMessageParserTest class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php @coversDefaultClass \Drupal\Core\Logger\LogMessageParser[[api-linebreak]] @group Logger
LogTest class Drupal\Tests\Core\Database core/tests/Drupal/Tests/Core/Database/LogTest.php Tests the Log class.
LogTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/LogTest.php Tests the Log process plugin.
LogTest class Drupal\Tests\migrate\Kernel\Plugin core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php Tests the Log process plugin.
LonelyMonkeyClass class Drupal\error_service_test core/modules/system/tests/modules/error_service_test/src/LonelyMonkeyClass.php A class with a single dependency. 1 2
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.
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.
MachineName class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/MachineName.php Provides a machine name render element. 1
MachineNameController class Drupal\system core/modules/system/src/MachineNameController.php Controller routines for machine name transliteration routes. 1
MachineNameControllerTest class Drupal\Tests\system\Unit\Transliteration core/modules/system/tests/src/Unit/Transliteration/MachineNameControllerTest.php Tests that the machine name controller can transliterate strings as expected.
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\KernelTests\Core\Render\Element core/tests/Drupal/KernelTests/Core/Render/Element/MachineNameTest.php @coversDefaultClass \Drupal\Core\Render\Element\MachineName[[api-linebreak]] @group Render
MachineNameTest class Drupal\FunctionalJavascriptTests\Core core/tests/Drupal/FunctionalJavascriptTests/Core/MachineNameTest.php Tests for the machine name field.
MachineNameTest class Drupal\Tests\Core\Render\Element core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php @coversDefaultClass \Drupal\Core\Render\Element\MachineName[[api-linebreak]] @group Render
Mail class Drupal\Core\Annotation core/lib/Drupal/Core/Annotation/Mail.php Defines a Mail annotation object.
Mail class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Mail.php Provides helpers to ensure emails are compliant with RFCs. 1
MailCaptureTest class Drupal\FunctionalTests core/tests/Drupal/FunctionalTests/MailCaptureTest.php Tests the collection of emails during testing.
MailFormatHelper class Drupal\Core\Mail core/lib/Drupal/Core/Mail/MailFormatHelper.php Defines a class containing utility methods for formatting mail messages. 6
MailFormatHelperTest class Drupal\Tests\Core\Mail core/tests/Drupal/Tests/Core/Mail/MailFormatHelperTest.php @coversDefaultClass \Drupal\Core\Mail\MailFormatHelper[[api-linebreak]] @group Mail
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 @coversDefaultClass \Drupal\contact\MailHandler[[api-linebreak]] @group contact
MailInterface interface Drupal\Core\Mail core/lib/Drupal/Core/Mail/MailInterface.php Defines an interface for pluggable mail back-ends. 3 3
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 @coversDefaultClass \Drupal\Core\Mail\MailManager[[api-linebreak]] @group Mail
MailTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/MailTest.php Test mail helpers implemented in Mail component.

Other projects


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