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
LoggerAwareStub class Drupal\logger_aware_test core/modules/system/tests/modules/logger_aware_test/src/LoggerAwareStub.php A test class that implements LoggerAwareInterface. 1 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. 1 2 2
LoggerChannelFactoryInterface interface Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelFactoryInterface.php Logger channel factory interface. 1 16
LoggerChannelFactoryTest class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php Tests Drupal\Core\Logger\LoggerChannelFactory.
LoggerChannelInterface interface Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelInterface.php Logger channel interface. 1 5
LoggerChannelTest class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php Tests Drupal\Core\Logger\LoggerChannel.
LoggerChannelTrait trait Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelTrait.php Wrapper methods for the logger factory service. 7
LoggerChannelWithoutConstructor class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php Call to test a logger channel class with no constructor.
LoggerStub class Drupal\logger_aware_test core/modules/system/tests/modules/logger_aware_test/src/LoggerStub.php A logger stub. 1 2
LoggingBeginner final class Drupal\package_manager core/modules/package_manager/src/LoggingBeginner.php Logs Composer Stager's Beginner process output to a file. 2
LoggingBeginner final class Drupal\package_manager_bypass core/modules/package_manager/tests/modules/package_manager_bypass/src/LoggingBeginner.php A composer-stager Beginner decorator that adds logging. 1
LoggingBeginnerTest class Drupal\Tests\package_manager\Unit core/modules/package_manager/tests/src/Unit/LoggingBeginnerTest.php Tests Logging Beginner.
LoggingCommitter class Drupal\package_manager core/modules/package_manager/src/LoggingCommitter.php Logs Composer Stager's Committer process output to a file. 2
LoggingCommitter final class Drupal\package_manager_bypass core/modules/package_manager/tests/modules/package_manager_bypass/src/LoggingCommitter.php A composer-stager Committer decorator that adds logging. 3
LoggingCommitterTest class Drupal\Tests\package_manager\Unit core/modules/package_manager/tests/src/Unit/LoggingCommitterTest.php Tests Logging Committer.
LoggingDecoratorTrait trait Drupal\package_manager_bypass core/modules/package_manager/tests/modules/package_manager_bypass/src/LoggingDecoratorTrait.php Records information about method invocations.
LoggingForm class Drupal\system\Form core/modules/system/src/Form/LoggingForm.php Configure logging settings for this site. 1
LoggingStager final class Drupal\package_manager core/modules/package_manager/src/LoggingStager.php Logs Composer Stager's Stager process output to a file. 2
LoggingStagerTest class Drupal\Tests\package_manager\Unit core/modules/package_manager/tests/src/Unit/LoggingStagerTest.php Tests Logging Stager.
LoggingTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/LoggingTest.php Tests the query logging facility.
LoginCommand class Drupal\user\Command core/modules/user/src/Command/LoginCommand.php Generate a one-time login link. 2
LoginCommandTest class Drupal\Tests\user\Kernel\Command core/modules/user/tests/src/Kernel/Command/LoginCommandTest.php Tests user:login console command failure modes (blocked, user not found).
LoginCommandTest class Drupal\Tests\user\Functional\Command core/modules/user/tests/src/Functional/Command/LoginCommandTest.php Tests user:login runs as a console command and generates a working link.
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 4
LogMessageParserTest class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php Tests Drupal\Core\Logger\LogMessageParser.
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.
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.

Other projects


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