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
MimeTypeMapTest class Drupal\Tests\Core\File\MimeType core/tests/Drupal/Tests/Core/File/MimeType/MimeTypeMapTest.php Tests the MIME type mapper to extension.
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.
MissingAttributes class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-classes-missing-attributes.php
MissingAttributesTest class Drupal\Tests\Core\Foo core/tests/fixtures/test_driver/MissingAttributesTest.php
MissingAttributesWithDataProviderTest class Drupal\Tests\Core\Foo core/tests/fixtures/test_driver/MissingAttributesWithDataProviderTest.php
MissingBundleClassException class Drupal\Core\Entity\Exception core/lib/Drupal/Core/Entity/Exception/MissingBundleClassException.php Exception thrown if a bundle class does not exist. 2
MissingClassDetectionClassLoader final class Drupal\Component\Discovery core/lib/Drupal/Component/Discovery/MissingClassDetectionClassLoader.php Defines a classloader that detects missing classes. 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
MissingGroup class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-classes-missing-attributes.php #[RunTestsInSeparateProcesses]
MissingGroupException class Drupal\Core\Test\Exception core/lib/Drupal/Core/Test/Exception/MissingGroupException.php Exception thrown when a test class is missing the 'group' metadata. 2
MissingRunTestsInSeparateProcesses class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-classes-missing-attributes.php #[Group('Test')]
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
MockClient class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/WebAssertTest.php A mock client.
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.
MockContainerInjection class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php Mock for the injected service.
MockContainerInjection class Drupal\Tests\Core\Utility core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php Test class mocking container injection.
MockController class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php Mock for the controller.
MockControllerPsr7 class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php Mock for the PSR-7 controller.
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. 8
MockFileFinderTest class Drupal\Tests\Component\Annotation core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php Tests Drupal\Component\Annotation\Reflection\MockFileFinder.
MockFormBase abstract class Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php Interface used in the mocking process of this test.
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 Test class used for testing the Controller resolver class.
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.
MockMenuBlockDeriver class Drupal\plugin_test\Plugin\plugin_test\mock_block core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockMenuBlockDeriver.php Mock implementation of DeriverInterface for the mock menu block plugin.
MockPathLocator final class Drupal\package_manager_bypass core/modules/package_manager/tests/modules/package_manager_bypass/src/MockPathLocator.php Mock path locator: allows specifying paths instead of discovering paths.
MockPhpStorage class Drupal\system\PhpStorage core/modules/system/src/PhpStorage/MockPhpStorage.php Mock PHP storage class used for testing. 1
MockRouteProvider class Drupal\system\Tests\Routing core/modules/system/src/Tests/Routing/MockRouteProvider.php Easily configurable mock route provider. 3
MockRouterInterface interface Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php Interface used in the mocking process of this test.
MockService class Drupal\Tests\Component\DependencyInjection core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php Helper class to test Container::get() method.
MockTestBlock class Drupal\plugin_test\Plugin\plugin_test\mock_block core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockTestBlock.php Mock implementation of a test block plugin used by Plugin API unit tests.
MockUserLoginBlock class Drupal\plugin_test\Plugin\plugin_test\mock_block core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserLoginBlock.php Mock implementation of a login block plugin used by Plugin API unit tests.
MockUserNameBlock class Drupal\plugin_test\Plugin\plugin_test\mock_block core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserNameBlock.php Implementation of a user name block plugin used by Plugin API context test.
ModalRenderer class Drupal\Core\Render\MainContent core/lib/Drupal/Core/Render/MainContent/ModalRenderer.php Default main content renderer for modal dialog requests. 1 1 2
ModalRendererTest class Drupal\Tests\system\FunctionalJavascript core/modules/system/tests/src/FunctionalJavascript/ModalRendererTest.php Tests that dialog links use different renderer services.
ModeratedContentController class Drupal\content_moderation\Controller core/modules/content_moderation/src/Controller/ModeratedContentController.php Defines a controller to list moderated nodes.
ModeratedContentLocalTaskTest class Drupal\Tests\content_moderation\Functional core/modules/content_moderation/tests/src/Functional/ModeratedContentLocalTaskTest.php Tests moderated content dynamic local task.

Other projects


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