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
LocaleUpdateTest class Drupal\Tests\locale\Kernel core/modules/locale/tests/src/Kernel/LocaleUpdateTest.php Tests for updating the interface translations of projects.
LocaleUpdateTest class Drupal\Tests\locale\Functional core/modules/locale/tests/src/Functional/LocaleUpdateTest.php Tests for updating the interface translations of projects.
LocalReadOnlyStream abstract class Drupal\Core\StreamWrapper core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php Defines a read-only Drupal stream wrapper base class for local files. 1 1
LocalRedirectResponse class Drupal\Core\Routing core/lib/Drupal/Core/Routing/LocalRedirectResponse.php Provides a redirect response which cannot redirect to an external URL. 2
LocalStream abstract class Drupal\Core\StreamWrapper core/lib/Drupal/Core/StreamWrapper/LocalStream.php Defines a Drupal stream wrapper base class for local files. 6 3
LocalTaskDefault class Drupal\Core\Menu core/lib/Drupal/Core/Menu/LocalTaskDefault.php Default object used for LocalTaskPlugins. 6 6 3
LocalTaskDefaultTest class Drupal\Tests\Core\Menu core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php @coversDefaultClass \Drupal\Core\Menu\LocalTaskDefault @group Menu
LocalTaskIntegrationTestBase abstract class Drupal\Tests\Core\Menu core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php Defines a base unit test for testing existence of local tasks. 14 14
LocalTaskInterface interface Drupal\Core\Menu core/lib/Drupal/Core/Menu/LocalTaskInterface.php Defines an interface for menu local tasks. 1 1
LocalTaskManager class Drupal\Core\Menu core/lib/Drupal/Core/Menu/LocalTaskManager.php Provides the default local task manager using YML as primary definition. 2 2
LocalTaskManagerInterface interface Drupal\Core\Menu core/lib/Drupal/Core/Menu/LocalTaskManagerInterface.php Manages discovery and instantiation of menu local task plugins. 1 1
LocalTaskManagerTest class Drupal\Tests\Core\Menu core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php @coversDefaultClass \Drupal\Core\Menu\LocalTaskManager @group Menu
LocalTasksBlock class Drupal\Core\Menu\Plugin\Block core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php Provides a "Tabs" block to display the local tasks.
LocalTasksTest class Drupal\Tests\system\Functional\Menu core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php Tests local tasks derived from router and added/altered via hooks.
LocalTaskTest class Drupal\menu_test\Plugin\Derivative core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php 1
LocalTaskTestWithUnsafeTitle class Drupal\menu_test\Plugin\Derivative core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTestWithUnsafeTitle.php Test derivative to check local task title escaping. 1
Lock final class Drupal\Core\TempStore core/lib/Drupal/Core/TempStore/Lock.php Provides a value object representing the lock from a TempStore. 4
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 @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.
Log class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/Log.php Logs values without changing them.
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 5
LoggerChannelFactory class Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelFactory.php Defines a factory for logging channels. 2 2
LoggerChannelFactoryInterface interface Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelFactoryInterface.php Logger channel factory interface. 1 7
LoggerChannelFactoryTest class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php @coversDefaultClass \Drupal\Core\Logger\LoggerChannelFactory @group Logger
LoggerChannelInterface interface Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelInterface.php Logger channel interface. 1 3
LoggerChannelTest class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php @coversDefaultClass \Drupal\Core\Logger\LoggerChannel @group Logger
LoggerChannelTrait trait Drupal\Core\Logger core/lib/Drupal/Core/Logger/LoggerChannelTrait.php Wrapper methods for the logger factory service. 3
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 @group Logger
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\Core\Render\Element core/lib/Drupal/Core/Render/Element/MachineName.php Provides a machine name render element. 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.
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\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 @group Render

Other projects


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