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
LayoutTempstoreRepository class Drupal\layout_builder core/modules/layout_builder/src/LayoutTempstoreRepository.php Provides a mechanism for loading layouts from tempstore. 1 2
LayoutTempstoreRepositoryInterface interface Drupal\layout_builder core/modules/layout_builder/src/LayoutTempstoreRepositoryInterface.php Provides an interface for loading layouts from tempstore. 1 14
LayoutTempstoreRepositoryTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRepositoryTest.php @coversDefaultClass \Drupal\layout_builder\LayoutTempstoreRepository @group layout_builder
LayoutTest class Drupal\Tests\layout_discovery\Kernel core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php Tests Layout functionality.
LayoutTestDependenciesPlugin class Drupal\layout_test\Plugin\Layout core/modules/system/tests/modules/layout_test/src/Plugin/Layout/LayoutTestDependenciesPlugin.php Provides a plugin that contains config dependencies.
LayoutTestPlugin class Drupal\layout_test\Plugin\Layout core/modules/system/tests/modules/layout_test/src/Plugin/Layout/LayoutTestPlugin.php The plugin that handles the default layout template.
LazyContextRepository class Drupal\Core\Plugin\Context core/lib/Drupal/Core/Plugin/Context/LazyContextRepository.php Provides a context repository which uses context provider services. 2 2
LazyContextRepositoryTest class Drupal\Tests\Core\Plugin\Context core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php @coversDefaultClass \Drupal\Core\Plugin\Context\LazyContextRepository @group context
LazyPluginCollection abstract class Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/LazyPluginCollection.php Defines an object which stores multiple plugin instances to lazy load them. 3 3
LazyPluginCollectionTestBase abstract class Drupal\Tests\Core\Plugin core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php Provides a base class for plugin collection tests. 2
LazyRouteProviderInstallTest class Drupal\FunctionalTests\Routing core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php @group routing
LegacyAliasStorageTest class Drupal\KernelTests\Core\Path core/tests/Drupal/KernelTests/Core/Path/LegacyAliasStorageTest.php @coversDefaultClass \Drupal\Core\Path\AliasStorage @group path @group legacy
LegacyBlockPluginIdTest class Drupal\Tests\block\Unit\Plugin\migrate\process core/modules/block/tests/src/Unit/Plugin/migrate/process/LegacyBlockPluginIdTest.php Tests legacy usage of BlockPluginId.
LegacyBlockVisibilityTest class Drupal\Tests\block\Unit\Plugin\migrate\process core/modules/block/tests/src/Unit/Plugin/migrate/process/LegacyBlockVisibilityTest.php Tests the block_visibility process plugin.
LegacyContentEntityStorageBaseTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/LegacyContentEntityStorageBaseTest.php Tests deprecated methods of ContentEntityStorageBase.
LegacyDestinationCategoryTest class Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/LegacyDestinationCategoryTest.php Extends DestinationCategoryTest to test with deprecated modules.
LegacyEntityDisplayBaseTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/LegacyEntityDisplayBaseTest.php Tests Deprecated EntityDisplayBase functionality.
LegacyFieldTypePluginManagerTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/LegacyFieldTypePluginManagerTest.php Extends FieldTypePluginManagerTest to test with deprecated modules.
LegacyFileTest class Drupal\Tests\file\Unit core/modules/file/tests/src/Unit/LegacyFileTest.php Provides unit tests for file module deprecation errors.
LegacyForumTest class Drupal\Tests\forum\Kernel core/modules/forum/tests/src/Kernel/LegacyForumTest.php Tests Legacy forum code.
LegacyFunctionsTest class Drupal\KernelTests\Core\Common core/tests/Drupal/KernelTests/Core/Common/LegacyFunctionsTest.php Tests legacy functions in common.inc.
LegacyHelpTopicsSyntaxTest class Drupal\Tests\help_topics\Functional core/modules/help_topics/tests/src/Functional/LegacyHelpTopicsSyntaxTest.php Extends HelpTopicsSyntaxTest to test with deprecated modules.
LegacyJavascriptTestBase

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal\FunctionalJavascriptTests\WebDriverTestBase instead

BC layer for testing browser interaction implemented in JavaScript.

abstract class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/LegacyJavascriptTestBase.php Runs a browser test using PhantomJS.
LegacyLibraryDiscoveryTest class Drupal\KernelTests\Core\Asset core/tests/Drupal/KernelTests/Core/Asset/LegacyLibraryDiscoveryTest.php Tests that deprecated asset libraries trigger a deprecation error.
LegacyMessenger

in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Messenger\Messenger instead.

class Drupal\Core\Messenger core/lib/Drupal/Core/Messenger/LegacyMessenger.php Provides a LegacyMessenger implementation. 2
LegacyMigrateDrupal6AuditIdsTest class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/LegacyMigrateDrupal6AuditIdsTest.php Extends MigrateDrupal6AuditIdsTest to test with deprecated modules.
LegacyMigrateDrupal7AuditIdsTest class Drupal\Tests\migrate_drupal\Kernel\d7 core/modules/migrate_drupal/tests/src/Kernel/d7/LegacyMigrateDrupal7AuditIdsTest.php Extends MigrateDrupal7AuditIdsTest to test with deprecated modules.
LegacyMigrateUrlAliasTest class Drupal\Tests\path\Kernel\Migrate\d6 core/modules/path/tests/src/Kernel/Migrate/d6/LegacyMigrateUrlAliasTest.php Tests legacy URL alias migration.
LegacyMigrateUrlAliasTest class Drupal\Tests\path\Kernel\Migrate\d7 core/modules/path/tests/src/Kernel/Migrate/d7/LegacyMigrateUrlAliasTest.php Tests legacy URL alias migration.
LegacyMigrationLabelExistTest class Drupal\Tests\migrate_drupal_ui\Kernel core/modules/migrate_drupal_ui/tests/src/Kernel/LegacyMigrationLabelExistTest.php Extends MigrationLabelExistTest to test with deprecated modules.
LegacyMigrationLookupTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/LegacyMigrationLookupTest.php Tests deprecated features of the migration lookup plugin.
LegacyMigrationProcessTest class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/LegacyMigrationProcessTest.php Extends Drupal\Tests\migrate_drupal\Kernel\d6\MigrationProcessTest to test with deprecated modules.
LegacyMigrationProcessTest class Drupal\Tests\migrate_drupal\Kernel\d7 core/modules/migrate_drupal/tests/src/Kernel/d7/LegacyMigrationProcessTest.php Extends Drupal\Tests\migrate_drupal\Kernel\d7\MigrationProcessTest to test with deprecated modules.
LegacyMigrationProvidersExistTest class Drupal\Tests\migrate\Kernel\Plugin core/modules/migrate/tests/src/Kernel/Plugin/LegacyMigrationProvidersExistTest.php Extends MigrationProvidersExistTest to test with deprecated modules.
LegacyStateFileExists class Drupal\Tests\migrate_drupal\Kernel core/modules/migrate_drupal/tests/src/Kernel/LegacyStateFileExists.php Extends StateFileExists to test with deprecated modules.
LegacyStyleSheetsRemoveTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/LegacyStyleSheetsRemoveTest.php Tests the legacy stylesheets-remove key.
LegacyThemeHandlerTest class Drupal\KernelTests\Core\Extension core/tests/Drupal/KernelTests/Core/Extension/LegacyThemeHandlerTest.php Tests deprecated theme handler methods.
LegacyValidateMigrationStateTest class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/LegacyValidateMigrationStateTest.php Extends Drupal\Tests\migrate_drupal\Kernel\d6\ValidateMigrationStateTest to test with deprecated modules.
LegacyValidateMigrationStateTest class Drupal\Tests\migrate_drupal\Kernel\d7 core/modules/migrate_drupal/tests/src/Kernel/d7/LegacyValidateMigrationStateTest.php Extends Drupal\Tests\migrate_drupal\Kernel\d7\ValidateMigrationStateTest to test with deprecated modules.
LengthConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/LengthConstraint.php Length constraint.
LibrariesDirectoryFileFinder class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibrariesDirectoryFileFinder.php Finds files that are located in the supported 'libraries' directories. 2 2
LibrariesDirectoryFileFinderTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php @coversDefaultClass \Drupal\Core\Asset\LibrariesDirectoryFileFinder @group Asset
LibraryCachingTest class Drupal\Tests\views_ui\FunctionalJavascript core/modules/views_ui/tests/src/FunctionalJavascript/LibraryCachingTest.php Tests the JavaScript library caching on consecutive requests.
LibraryDefinitionMissingLicenseException class Drupal\Core\Asset\Exception core/lib/Drupal/Core/Asset/Exception/LibraryDefinitionMissingLicenseException.php Defines a custom exception if a library has a remote but no license. 2
LibraryDependencyResolver class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDependencyResolver.php Resolves the dependencies of asset (CSS/JavaScript) libraries. 1 2
LibraryDependencyResolverInterface interface Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDependencyResolverInterface.php Resolves the dependencies of asset (CSS/JavaScript) libraries. 1
LibraryDependencyResolverTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php @coversDefaultClass \Drupal\Core\Asset\LibraryDependencyResolver @group Asset
LibraryDiscovery class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDiscovery.php Discovers available asset libraries in Drupal. 1 2
LibraryDiscoveryCollector class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php A CacheCollector implementation for building library extension info. 1 2
LibraryDiscoveryCollectorTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php @coversDefaultClass \Drupal\Core\Asset\LibraryDiscoveryCollector @group Asset

Other projects


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