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
ManagedFile class Drupal\file\Element core/modules/file/src/Element/ManagedFile.php Provides an AJAX/progress aware widget for uploading and saving a file. 2
ManagedFileTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/ManagedFileTest.php Managed file element test.
ManageDisplayTest class Drupal\Tests\field_ui\FunctionalJavascript core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php Tests the Field UI "Manage display" and "Manage form display" screens.
ManageDisplayTest class Drupal\Tests\field_ui\Functional core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php Tests the Field UI "Manage display" and "Manage form display" screens.
ManagedStorage final class Drupal\Core\Config core/lib/Drupal/Core/Config/ManagedStorage.php The managed storage defers all the storage method calls to the manager. 1 2
ManagedStorageTest class Drupal\KernelTests\Core\Config\Storage core/tests/Drupal/KernelTests/Core/Config/Storage/ManagedStorageTest.php Tests ManagedStorage operations.
ManageFieldsFunctionalTest class Drupal\Tests\field_ui\Functional core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php Tests the Field UI "Manage fields" screen.
ManageFieldsFunctionalTestBase abstract class Drupal\Tests\field_ui\Functional core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTestBase.php Tests the Field UI "Manage fields" screen. 3
ManageFieldsLifecycleTest class Drupal\Tests\field_ui\Functional core/modules/field_ui/tests/src/Functional/ManageFieldsLifecycleTest.php Tests the Field UI "Manage fields" screen.
ManageFieldsMultipleTypesTest class Drupal\Tests\field_ui\Functional core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php Tests the Field UI "Manage fields" screen.
ManageFieldsTest class Drupal\Tests\field_ui\FunctionalJavascript core/modules/field_ui/tests/src/FunctionalJavascript/ManageFieldsTest.php Tests the Field UI "Manage Fields" screens.
ManageFieldsTest class Drupal\Tests\field_ui\Functional core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php Tests the Manage Display page of a fieldable entity type.
ManageGitIgnore class Drupal\Composer\Plugin\Scaffold composer/Plugin/Scaffold/ManageGitIgnore.php Manage the .gitignore file.
ManageGitIgnoreTest class Drupal\Tests\Composer\Plugin\Scaffold\Functional core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php Tests to see whether .gitignore files are correctly managed.
ManageOptions class Drupal\Composer\Plugin\Scaffold composer/Plugin/Scaffold/ManageOptions.php Per-project options from the 'extras' section of the composer.json file.
ManyAssetsLoadOrderTest class Drupal\FunctionalTests\Libraries core/tests/Drupal/FunctionalTests/Libraries/ManyAssetsLoadOrderTest.php Tests the loading of many weighted assets.
ManyAssetsTestController class Drupal\many_assets_test\Controller core/modules/system/tests/modules/many_assets_test/src/Controller/ManyAssetsTestController.php Provides a controller for testing asset loading order.
ManyAssetsTestHooks class Drupal\many_assets_test\Hook core/modules/system/tests/modules/many_assets_test/src/Hook/ManyAssetsTestHooks.php Hook implementations for many_assets_test.
ManyPlaceholderTest class Drupal\Tests\big_pipe\Unit\Render core/modules/big_pipe/tests/src/Unit/Render/ManyPlaceholderTest.php Tests Drupal\big_pipe\Render\BigPipe.
ManyToOne class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/ManyToOne.php Complex filter to handle filtering for many to one relationships. 5 4
ManyToOne class Drupal\views\Plugin\views\argument core/modules/views/src/Plugin/views/argument/ManyToOne.php Argument handler for many to one relationships. 2 2
ManyToOneHelper class Drupal\views core/modules/views/src/ManyToOneHelper.php This many to one helper object is used on both arguments and filters. 3
Map class Drupal\Core\TypedData\Plugin\DataType core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php The "map" data type. 1 1
MapBaseFieldTest class Drupal\KernelTests\Core\Field core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php Tests map base fields.
MapDataDefinition class Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/MapDataDefinition.php A typed data definition class for defining maps. 13 1
MapDataNormalizerTest class Drupal\Tests\serialization\Kernel core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php Tests Map Data Normalizer.
MapFieldItemList class Drupal\Core\Field core/lib/Drupal/Core/Field/MapFieldItemList.php Defines an item list class for map fields. 1
MapItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php Defines the 'map' entity field type.
MappedClass class Drupal\Tests\Component\Annotation\Doctrine\Ticket core/tests/Drupal/Tests/Component/Annotation/Doctrine/Ticket/DCOM58Test.php @Entity
MappedDiff class Drupal\Component\Diff core/lib/Drupal/Component/Diff/MappedDiff.php FIXME: bad name. @todo document @private @subpackage DifferenceEngine 1
MapperExceptionInterface interface Drupal\Component\Plugin\Exception core/lib/Drupal/Component/Plugin/Exception/MapperExceptionInterface.php Base exception interface for grouping mapper exceptions.
MapperInterface interface Drupal\Component\Plugin\Mapper core/lib/Drupal/Component/Plugin/Mapper/MapperInterface.php Plugin mapper interface. 1 3
Mapping class Drupal\Core\Config\Schema core/lib/Drupal/Core/Config/Schema/Mapping.php Defines a mapping configuration element. 12 1
Mapping abstract class Drupal\views\Plugin\views\style core/modules/views/src/Plugin/views/style/Mapping.php Allows fields to be mapped to specific use cases. 1 1
MappingCollectionConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/MappingCollectionConstraint.php Checks that at least one of the given constraints is satisfied. 1
MappingCollectionConstrainTest class Drupal\KernelTests\Core\Validation core/tests/Drupal/KernelTests/Core/Validation/MappingCollectionConstrainTest.php Tests nested composite validation constraints.
MappingCollectionConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/MappingCollectionConstraintValidator.php Validates the MappingCollection constraint. 1
MappingTest class Drupal\KernelTests\Config\Schema core/tests/Drupal/KernelTests/Config/Schema/MappingTest.php Tests Drupal\Core\Config\Schema\Mapping.
MappingTest class Drupal\views_test_data\Plugin\views\style core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/MappingTest.php Provides a test plugin for the mapping style.
Marker class Drupal\Tests\Component\Annotation\Doctrine core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php
Markup final class Drupal\Core\Render core/lib/Drupal/Core/Render/Markup.php Defines an object that passes safe strings through the render system. 37
Markup class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/Markup.php Handler to run a field through check_markup, using a companion format field.
MarkupInterface interface Drupal\Component\Render core/lib/Drupal/Component/Render/MarkupInterface.php Marks an object's __toString() method as returning markup. 13 47
MarkupInterfaceComparator class Drupal\TestTools\Comparator core/tests/Drupal/TestTools/Comparator/MarkupInterfaceComparator.php Compares MarkupInterface objects for equality. 3
MarkupInterfaceComparatorTest class Drupal\KernelTests\Core\Test\Comparator core/tests/Drupal/KernelTests/Core/Test/Comparator/MarkupInterfaceComparatorTest.php Tests \Drupal\TestTools\Comparator\MarkupInterfaceComparator.
MarkupNormalizer class Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/MarkupNormalizer.php Normalizes MarkupInterface objects into a string. 1 2
MarkupNormalizerTest final class Drupal\Tests\serialization\Unit\Normalizer core/modules/serialization/tests/src/Unit/Normalizer/MarkupNormalizerTest.php Tests Drupal\serialization\Normalizer\MarkupNormalizer.
MarkupTrait trait Drupal\Component\Render core/lib/Drupal/Component/Render/MarkupTrait.php Implements MarkupInterface and Countable for rendered objects. 8
MatcherDumper class Drupal\Core\ProxyClass\Routing core/lib/Drupal/Core/ProxyClass/Routing/MatcherDumper.php Provides a proxy class for \Drupal\Core\Routing\MatcherDumper.
MatcherDumper class Drupal\Core\Routing core/lib/Drupal/Core/Routing/MatcherDumper.php Dumps Route information to a database table. 2 2

Other projects


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