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
MoreLink class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/MoreLink.php Provides a link render element for a "more" link, like those used in blocks.
MoveBlockController class Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/MoveBlockController.php Defines a controller to move a block.
MoveBlockForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/MoveBlockForm.php Provides a form for moving a block. 1
MoveBlockFormTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php Tests moving blocks via the form.
MoveTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/MoveTest.php Tests the file move function.
MTimeProtectedFastFileStorage class Drupal\Component\PhpStorage core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php Stores PHP code in files with securely hashed names. 1 1
MTimeProtectedFastFileStorageTest class Drupal\Tests\Component\PhpStorage core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php Tests the MTimeProtectedFastFileStorage implementation.
MTimeProtectedFileStorage class Drupal\Component\PhpStorage core/lib/Drupal/Component/PhpStorage/MTimeProtectedFileStorage.php Stores PHP code in files with securely hashed names. 2
MTimeProtectedFileStorageBase abstract class Drupal\Tests\Component\PhpStorage core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php Base test class for MTime protected storage. 2
MTimeProtectedFileStorageTest class Drupal\Tests\Component\PhpStorage core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php Tests the MTimeProtectedFileStorage implementation.
MultiFormTest class Drupal\FunctionalJavascriptTests\Ajax core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php Tests AJAX-enabled forms when multiple instances of the form are on a page.
MultiItemsFieldHandlerInterface interface Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/MultiItemsFieldHandlerInterface.php Defines a field handler which renders multiple items per row. 2
MultilingualReviewPageTest class Drupal\Tests\contact\Functional\migrate_drupal_ui\d6 core/modules/contact/tests/src/Functional/migrate_drupal_ui/d6/MultilingualReviewPageTest.php Tests migrate upgrade review page for Drupal 6.
MultilingualReviewPageTest class Drupal\Tests\contact\Functional\migrate_drupal_ui\d7 core/modules/contact/tests/src/Functional/migrate_drupal_ui/d7/MultilingualReviewPageTest.php Tests migrate upgrade review page for Drupal 7.
MultilingualReviewPageTest class Drupal\Tests\migrate_drupal_ui\Functional\d6 core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php Tests migrate upgrade review page for Drupal 6.
MultilingualReviewPageTest class Drupal\Tests\migrate_drupal_ui\Functional\d7 core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php Tests migrate upgrade review page for Drupal 7.
MultilingualReviewPageTestBase abstract class Drupal\Tests\migrate_drupal_ui\Functional core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php Provides a base class for testing the review step of the Upgrade form. 5 4
MultipleAttributes final class Drupal\Tests\Component\Annotation\Doctrine\Fixtures\Attribute core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/Attribute/MultipleAttributes.php #[\Attribute] #[AttributeClass]
MultipleBlockFormTest class Drupal\KernelTests\Core\Block core/tests/Drupal/KernelTests/Core/Block/MultipleBlockFormTest.php Tests that blocks can have multiple forms.
MultipleDistributionsProfileTest class Drupal\FunctionalTests\Installer core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php Tests multiple distribution profile support.
MultipleFileUploadTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/MultipleFileUploadTest.php Tests multiple file upload.
MultipleProviderAnnotationInterface interface Drupal\migrate\Annotation core/modules/migrate/src/Annotation/MultipleProviderAnnotationInterface.php Defines a common interface for classed annotations with multiple providers. 1 1
MultipleStaticContext class Drupal\block_test\ContextProvider core/modules/block/tests/modules/block_test/src/ContextProvider/MultipleStaticContext.php Sets multiple contexts for a static value. 2
MultipleValueWidgetTest class Drupal\Tests\field\FunctionalJavascript core/modules/field/tests/src/FunctionalJavascript/MultipleValueWidgetTest.php Tests widget form for a multiple value field.
MultipleWidgetFormTest class Drupal\Tests\field\Functional core/modules/field/tests/src/Functional/MultipleWidgetFormTest.php Tests field form handling.
MultiplexErrorFormatter final class Drupal\PHPStan\ErrorFormatter core/tests/PHPStan/ErrorFormatter/MultiplexErrorFormatter.php Configurable error formatter that outputs to multiple formatters/files.
MultisiteValidator final class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/MultisiteValidator.php Checks that the current site is not part of a multisite. 1
MultisiteValidatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/MultisiteValidatorTest.php Tests Multisite Validator.
MultiStepNodeFormBasicOptionsTest class Drupal\Tests\node\Functional core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php Tests the persistence of basic options through multiple steps.
MultiValueTestItem class Drupal\entity_test_update\Plugin\Field\FieldType core/modules/system/tests/modules/entity_test_update/src/Plugin/Field/FieldType/MultiValueTestItem.php Defines the 'multi_value_test' field type.
MultiWidthLayoutBase abstract class Drupal\layout_builder\Plugin\Layout core/modules/layout_builder/src/Plugin/Layout/MultiWidthLayoutBase.php Base class of layouts with configurable widths. 2
MySqlCastedIntFieldJoinTest class Drupal\Tests\mysql\Kernel\mysql\Plugin\views core/modules/mysql/tests/src/Kernel/mysql/Plugin/views/MySqlCastedIntFieldJoinTest.php Tests MySQL specific cast handling.
MysqlCastSql class Drupal\mysql\Plugin\views\query core/modules/mysql/src/Plugin/views/query/MysqlCastSql.php MySQL specific cast handling. 1 3
MysqlDateSql class Drupal\views\Plugin\views\query core/modules/views/src/Plugin/views/query/MysqlDateSql.php MySQL-specific date handling. 1 2
MysqlDateSqlTest class Drupal\Tests\views\Unit\Plugin\views\query core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php Tests the MySQL-specific date query handler.
MysqlDriverTest class Drupal\Tests\mysql\Kernel\mysql core/modules/mysql/tests/src/Kernel/mysql/MysqlDriverTest.php Tests the deprecations of the MySQL database driver classes in Core.
MysqlHooks class Drupal\mysql\Hook core/modules/mysql/src/Hook/MysqlHooks.php Hook implementations for mysql.
MysqliCastSql class Drupal\mysqli\Plugin\views\query core/modules/mysqli/src/Plugin/views/query/MysqliCastSql.php MySQLi specific cast handling. 2
MysqliHooks class Drupal\mysqli\Hook core/modules/mysqli/src/Hook/MysqliHooks.php Hook implementations for mysqli.
MysqlRequirements class Drupal\mysql\Hook core/modules/mysql/src/Hook/MysqlRequirements.php Requirements for the MySQL module.
MysqlServiceProvider class Drupal\mysql core/modules/mysql/src/MysqlServiceProvider.php Registers the 'mysql.views.cast_sql' service when views is installed.
Name class Drupal\Tests\Component\Annotation\Doctrine core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php
Name class Drupal\user\Plugin\views\filter core/modules/user/src/Plugin/views/filter/Name.php Filter handler for usernames. 1 1
NamedPlaceholderConverter final class Drupal\mysqli\Driver\Database\mysqli core/modules/mysqli/src/Driver/Database/mysqli/NamedPlaceholderConverter.php A class to convert a SQL statement with named placeholders to positional. 1
NamedPlaceholderConverterTest class Drupal\Tests\mysqli\Unit core/modules/mysqli/tests/src/Unit/NamedPlaceholderConverterTest.php Tests \Drupal\mysqli\Driver\Database\mysqli\NamedPlaceholderConverter.
NaughtyRecursiveLogger class Drupal\Tests\Core\Logger core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php Stub class for testing LoggerChannel.
NavigationBlockUiTest class Drupal\Tests\navigation\FunctionalJavascript core/modules/navigation/tests/src/FunctionalJavascript/NavigationBlockUiTest.php Tests that the navigation block UI exists and stores data correctly.
NavigationBlockUiTest class Drupal\Tests\shortcut\FunctionalJavascript core/modules/shortcut/tests/src/FunctionalJavascript/NavigationBlockUiTest.php Tests the shortcuts block in the navigation block UI.
NavigationContentLinks final class Drupal\navigation core/modules/navigation/src/NavigationContentLinks.php Build the menu links for the Content menu. 1
NavigationContentLinksTest class Drupal\Tests\navigation\Kernel core/modules/navigation/tests/src/Kernel/NavigationContentLinksTest.php Tests \Drupal\navigation\NavigationContentLinks.

Other projects


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