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
MigrationPluginManagerInterface interface Drupal\migrate\Plugin core/modules/migrate/src/Plugin/MigrationPluginManagerInterface.php Migration plugin manager interface. 1 17
MigrationPluginManagerTest class Drupal\Tests\migrate\Unit core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php @coversDefaultClass \Drupal\migrate\Plugin\MigrationPluginManager[[api-linebreak]] @group migrate
MigrationPluginManagerTest class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/MigrationPluginManagerTest.php Tests the migration plugin manager.
MigrationProcessTest class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php Tests the getProcess() method of all Drupal 6 migrations.
MigrationProcessTest class Drupal\Tests\migrate_drupal\Kernel\d7 core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php Tests the getProcess() method of all Drupal 7 migrations.
MigrationProvidersExistTest class Drupal\Tests\migrate\Kernel\Plugin core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php Tests that modules exist for all source and destination plugins.
MigrationSourceCacheTest class Drupal\Tests\migrate\Kernel\Plugin\source core/modules/migrate/tests/src/Kernel/Plugin/source/MigrationSourceCacheTest.php Test source counts are correctly cached.
MigrationState class Drupal\migrate_drupal core/modules/migrate_drupal/src/MigrationState.php Determines the migrate state for all modules enabled on the source. 3 2
MigrationStateUnitTest class Drupal\Tests\migrate_drupal\Unit core/modules/migrate_drupal/tests/src/Unit/MigrationStateUnitTest.php Defines a class for testing \Drupal\migrate_drupal\MigrationState.
MigrationTest class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/MigrationTest.php Tests the migration plugin.
MigrationTest class Drupal\Tests\migrate\Kernel\Plugin core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php Tests the migration plugin.
MigrationTest class Drupal\Tests\migrate\Unit core/modules/migrate/tests/src/Unit/MigrationTest.php @coversDefaultClass \Drupal\migrate\Plugin\Migration[[api-linebreak]]
MigrationWithFollowUpInterface interface Drupal\migrate_drupal\Plugin core/modules/migrate_drupal/src/Plugin/MigrationWithFollowUpInterface.php Interface for migrations with follow-up migrations. 2 3
MimeTypeGuesser class Drupal\Core\ProxyClass\File\MimeType core/lib/Drupal/Core/ProxyClass/File/MimeType/MimeTypeGuesser.php Provides a proxy class for \Drupal\Core\File\MimeType\MimeTypeGuesser.
MimeTypeGuesser class Drupal\Core\File\MimeType core/lib/Drupal/Core/File/MimeType/MimeTypeGuesser.php Defines a MIME type guesser that also supports stream wrapper paths. 3 2
MimeTypeGuesserTest class Drupal\Tests\Core\File core/tests/Drupal/Tests/Core/File/MimeTypeGuesserTest.php @coversDefaultClass \Drupal\Core\File\MimeType\MimeTypeGuesser[[api-linebreak]] @group DrupalKernel
MimeTypePass

in drupal:9.1.0 and is removed from drupal:10.0.0. No direct replacement is provided.

class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/MimeTypePass.php Adds @mime_type_guesser tagged services to handle forwards compatibility. 2
MimeTypePassTest class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/MimeTypePassTest.php @coversDefaultClass \Drupal\Core\DependencyInjection\Compiler\MimeTypePass[[api-linebreak]] @group DependencyInjection @group legacy @runInSeparateProcess
MimeTypeTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/MimeTypeTest.php Tests filename mimetype detection.
Mini class Drupal\views\Plugin\views\pager core/modules/views/src/Plugin/views/pager/Mini.php The plugin to handle mini pager.
MinimalInstallerTest class Drupal\FunctionalTests\Installer core/tests/Drupal/FunctionalTests/Installer/MinimalInstallerTest.php Tests the interactive installer installing the minimal profile.
MinimalTest class Drupal\Tests\minimal\Functional core/profiles/minimal/tests/src/Functional/MinimalTest.php Tests Minimal installation profile expectations.
MiniPagerTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php Tests the mini pager plugin.
MissingBundleClassException class Drupal\Core\Entity\Exception core/lib/Drupal/Core/Entity/Exception/MissingBundleClassException.php Exception thrown if a bundle class does not exist. 2
MissingContentEvent class Drupal\Core\Config\Importer core/lib/Drupal/Core/Config/Importer/MissingContentEvent.php Wraps a configuration event for event listeners. 2
MissingDataException class Drupal\Core\TypedData\Exception core/lib/Drupal/Core/TypedData/Exception/MissingDataException.php Exception thrown when an operation misses a data value; i.e., it is unset. 3
MissingDependencyException class Drupal\Core\Extension core/lib/Drupal/Core/Extension/MissingDependencyException.php Exception class to throw when modules are missing on install. 5
MissingGroupException class Drupal\Core\Test\Exception core/lib/Drupal/Core/Test/Exception/MissingGroupException.php Exception thrown when a test class is missing an @group annotation. 2
MissingSchema class Drupal\block_test\Plugin\Condition core/modules/block/tests/modules/block_test/src/Plugin/Condition/MissingSchema.php Provides a 'missing_schema' condition.
MissingThemeDependencyException class Drupal\Core\Theme core/lib/Drupal/Core/Theme/MissingThemeDependencyException.php Exception to be thrown when base theme for installed theme is not installed.
MissingValueContextException class Drupal\Component\Plugin\Exception core/lib/Drupal/Component/Plugin/Exception/MissingValueContextException.php An exception class thrown when contexts exist but are missing a value. 3
MockAliasManager class Drupal\system\Tests\Routing core/modules/system/src/Tests/Routing/MockAliasManager.php An easily configurable mock alias manager. 1
MockBlockManager class Drupal\plugin_test\Plugin core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php Defines a plugin manager used by Plugin API derivative unit tests. 2
MockComplexContextBlock class Drupal\plugin_test\Plugin\plugin_test\mock_block core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockComplexContextBlock.php Implementation of a complex context plugin used by Plugin API context tests.
MockConfiguratorInterface interface Drupal\Tests\Component\DependencyInjection core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php Helper interface to test Container::get() with configurator.
MockContainerAware class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
MockContainerInjection class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
MockController class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
MockControllerPsr7 class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
MockedHttpKernelInterface interface Drupal\Tests\Core\StackMiddleware core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php Helper interface for the Symfony 6 version of the HttpKernelInterface.
MockFileFinder class Drupal\Component\Annotation\Reflection core/lib/Drupal/Component/Annotation/Reflection/MockFileFinder.php Defines a mock file finder that only returns a single filename. 4
MockFileFinderTest class Drupal\Tests\Component\Annotation core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php @coversDefaultClass \Drupal\Component\Annotation\Reflection\MockFileFinder[[api-linebreak]] @group Annotation
MockFileTransfer class Drupal\system_test core/modules/system/tests/modules/system_test/src/MockFileTransfer.php Mock FileTransfer object to test the settings form functionality.
MockHttpKernelInterface interface Drupal\Tests\Core\StackMiddleware core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php Helper interface for the Symfony 6 version of the HttpKernelInterface.
MockInstantiationService class Drupal\Tests\Component\DependencyInjection core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php Helper class to test Container::get() method for varying number of parameters.
MockInvokeController class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
MockLayoutBlock class Drupal\plugin_test\Plugin\plugin_test\mock_block core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlock.php Mock implementation of a layout block plugin used by Plugin API unit tests.
MockLayoutBlockDeriver class Drupal\plugin_test\Plugin\plugin_test\mock_block core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php Mock implementation of DeriverInterface for the mock layout block plugin.
MockMatcher class Drupal\Tests\system\Functional\Routing core/modules/system/tests/src/Functional/Routing/MockMatcher.php A mock matcher that can be configured with any matching logic for testing.
MockMenuBlock class Drupal\plugin_test\Plugin\plugin_test\mock_block core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockMenuBlock.php Mock implementation of a menu block plugin used by Plugin API unit tests.

Other projects


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