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
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. 2 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
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. 30
Markup class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/Markup.php A 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. 14 45
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. 2
MarkupTrait trait Drupal\Component\Render core/lib/Drupal/Component/Render/MarkupTrait.php Implements MarkupInterface and Countable for rendered objects. 9
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
MatcherDumperInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/MatcherDumperInterface.php Extends the symfony matcher dumper interface with a addRoutes method. 3
MatcherDumperTest class Drupal\KernelTests\Core\Routing core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php Confirm that the matcher dumper is functioning properly.
MatchingRouteNotFoundException class Drupal\Core\Routing core/lib/Drupal/Core/Routing/MatchingRouteNotFoundException.php No matching route was found.
MaximumFileSizeExceededUploadTest class Drupal\Tests\file\FunctionalJavascript core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php Tests uploading a file that exceeds the maximum file size.
Media class Drupal\media\Entity core/modules/media/src/Entity/Media.php Defines the media entity class. 37
Media class Drupal\media\Plugin\views\wizard core/modules/media/src/Plugin/views/wizard/Media.php Provides Views creation wizard for Media.
MediaAccessControlHandler class Drupal\media core/modules/media/src/MediaAccessControlHandler.php Defines an access control handler for media items.
MediaAccessControlHandlerTest class Drupal\Tests\media\Kernel core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php Tests the media access control handler.
MediaAccessTest class Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/MediaAccessTest.php Basic access tests for Media.
MediaBulkFormTest class Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/MediaBulkFormTest.php Tests a media bulk form.
MediaCacheTagsTest class Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/MediaCacheTagsTest.php Tests the media items cache tags.
MediaConfigSubscriber class Drupal\media\EventSubscriber core/modules/media/src/EventSubscriber/MediaConfigSubscriber.php Listens to the config save event for media.settings. 2
MediaContextualLinksTest class Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/MediaContextualLinksTest.php Tests views contextual links on media items.
MediaCreationTest class Drupal\Tests\media\Kernel core/modules/media/tests/src/Kernel/MediaCreationTest.php Tests creation of media types and media items.
MediaDeleteMultipleConfirmForm

in drupal:8.6.0 and is removed from drupal:9.0.0. This route is not used in Drupal core. As an internal API, it may also be removed in a minor release. If you are using it, copy the class and the related "entity.media.multiple_delete_confirm" route to your module.

class Drupal\media\Form core/modules/media/src/Form/MediaDeleteMultipleConfirmForm.php Provides a confirmation form to delete multiple media items at once. 1
MediaDisplayTest class Drupal\Tests\media\FunctionalJavascript core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php Basic display tests for Media.
MediaEmbed class Drupal\media\Plugin\Filter core/modules/media/src/Plugin/Filter/MediaEmbed.php Provides a filter to embed media items using a custom tag.
MediaEmbedFilterConfigurationUiTest class Drupal\Tests\media\FunctionalJavascript core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiTest.php @covers ::media_filter_format_edit_form_validate @group media
MediaEmbedFilterDisabledIntegrationsTest class Drupal\Tests\media\Kernel core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php Tests that media embed disables certain integrations.
MediaEmbedFilterTest class Drupal\Tests\media\Kernel core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php @coversDefaultClass \Drupal\media\Plugin\Filter\MediaEmbed @group media
MediaEmbedFilterTestBase abstract class Drupal\Tests\media\Kernel core/modules/media/tests/src/Kernel/MediaEmbedFilterTestBase.php Base class for Media Embed filter tests. 3
MediaEmbedFilterTranslationTest class Drupal\Tests\media\Kernel core/modules/media/tests/src/Kernel/MediaEmbedFilterTranslationTest.php Tests that media embeds are translated based on text (host entity) language.
MediaFilterController class Drupal\media\Controller core/modules/media/src/Controller/MediaFilterController.php Controller which renders a preview of the provided text. 1 1
MediaForm class Drupal\media core/modules/media/src/MediaForm.php Form controller for the media edit forms. 2
MediaFunctionalTestBase abstract class Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/MediaFunctionalTestBase.php Base class for Media functional tests. 14 1
MediaFunctionalTestCreateMediaTypeTrait

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\media\Traits\MediaTypeCreationTrait instead.

trait Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/MediaFunctionalTestCreateMediaTypeTrait.php Trait with helpers for Media functional tests.
MediaFunctionalTestTrait trait Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/MediaFunctionalTestTrait.php Trait with helpers for Media functional tests. 1
MediaHalJsonAnonTest class Drupal\Tests\media\Functional\Hal core/modules/media/tests/src/Functional/Hal/MediaHalJsonAnonTest.php @group hal 2
MediaHalJsonBasicAuthTest class Drupal\Tests\media\Functional\Hal core/modules/media/tests/src/Functional/Hal/MediaHalJsonBasicAuthTest.php @group hal
MediaHalJsonCookieTest class Drupal\Tests\media\Functional\Hal core/modules/media/tests/src/Functional/Hal/MediaHalJsonCookieTest.php @group hal
MediaInstallTest class Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/MediaInstallTest.php Tests media Install / Uninstall logic.
MediaInterface interface Drupal\media core/modules/media/src/MediaInterface.php Provides an interface defining an entity for media items. 1 15
MediaJavascriptTestBase abstract class Drupal\Tests\media\FunctionalJavascript core/modules/media/tests/src/FunctionalJavascript/MediaJavascriptTestBase.php Base class for Media functional JavaScript tests. 8

Other projects


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