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
MessageJsonCookieTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/MessageJsonCookieTest.php @group rest
MessagePlugin class Drupal\Composer\Plugin\ProjectMessage composer/Plugin/ProjectMessage/MessagePlugin.php A Composer plugin to display a message after creating a project.
MessageResourceTestBase abstract class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/MessageResourceTestBase.php 8 2
MessageResourceTestBase

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\contact\Functional\Rest\MessageResourceTestBase instead.

abstract class Drupal\Tests\rest\Functional\EntityResource\Message core/modules/rest/tests/src/Functional/EntityResource/Message/MessageResourceTestBase.php
Messages class Drupal\views\Plugin\views\area core/modules/views/src/Plugin/views/area/Messages.php Provides an area for messages. 1
MessagesBlockPluginInterface interface Drupal\Core\Block core/lib/Drupal/Core/Block/MessagesBlockPluginInterface.php The interface for "messages" (#type => status_messages) blocks. 1 2
MessagesTest class Drupal\Tests\views\Unit\Plugin\area core/modules/views/tests/src/Unit/Plugin/area/MessagesTest.php @coversDefaultClass \Drupal\views\Plugin\views\area\Messages @group views
MessageTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/MessageTest.php JSON:API integration test for the "Message" content entity type.
MessageTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php Tests built-in message theme functions.
MessageViewBuilder class Drupal\contact core/modules/contact/src/MessageViewBuilder.php Render controller for contact messages.
MessageXmlAnonTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/MessageXmlAnonTest.php @group rest
MessageXmlBasicAuthTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/MessageXmlBasicAuthTest.php @group rest
MessageXmlCookieTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/MessageXmlCookieTest.php @group rest
Messenger class Drupal\Core\Messenger core/lib/Drupal/Core/Messenger/Messenger.php The messenger service. 1 2
MessengerInterface interface Drupal\Core\Messenger core/lib/Drupal/Core/Messenger/MessengerInterface.php Stores runtime messages sent out to individual users on the page. 2 49
MessengerLegacyTest class Drupal\KernelTests\Core\Messenger core/tests/Drupal/KernelTests/Core/Messenger/MessengerLegacyTest.php @group Messenger @group legacy
MessengerTest class Drupal\KernelTests\Core\Messenger core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php @group Messenger @coversDefaultClass \Drupal\Core\Messenger\Messenger
MessengerTrait trait Drupal\Core\Messenger core/lib/Drupal/Core/Messenger/MessengerTrait.php Provides a trait for the messenger service. 9
MetadataBag class Drupal\Core\Session core/lib/Drupal/Core/Session/MetadataBag.php Provides a container for application specific session metadata. 1 2
MetadataBubblingUrlGenerator class Drupal\Core\Render core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php Decorator for the URL generator, which bubbles bubbleable URL metadata. 1 2
MetadataBubblingUrlGeneratorTest class Drupal\Tests\Core\Render core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php Confirm that the MetadataBubblingUrlGenerator is functioning properly.
MetadataGenerator class Drupal\quickedit core/modules/quickedit/src/MetadataGenerator.php Generates in-place editing metadata for an entity field. 2 2
MetadataGeneratorInterface interface Drupal\quickedit core/modules/quickedit/src/MetadataGeneratorInterface.php Interface for generating in-place editing metadata. 1
MetadataGeneratorTest class Drupal\Tests\quickedit\Kernel core/modules/quickedit/tests/src/Kernel/MetadataGeneratorTest.php Tests in-place field editing metadata.
MetapackageUpdateTest class Drupal\Tests\Composer\Generator core/tests/Drupal/Tests/Composer/Generator/MetapackageUpdateTest.php Test to see if the metapackages are up-to-date with the root composer.lock.
MethodFilter class Drupal\Core\Routing core/lib/Drupal/Core/Routing/MethodFilter.php Filters routes based on the HTTP method. 1 2
MethodFilterTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php @coversDefaultClass \Drupal\Core\Routing\MethodFilter @group Routing
MethodRequires class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/ExternalCommandRequirementTest.php
MigrateAccessCheck class Drupal\migrate_drupal_ui core/modules/migrate_drupal_ui/src/MigrateAccessCheck.php Checks access for migrate_drupal_ui routes.
MigrateAccessTest class Drupal\Tests\migrate_drupal_ui\Functional core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php Tests that only user 1 can access the migrate UI.
MigrateActionConfigsTest class Drupal\Tests\action\Kernel\Migrate\d6 core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php Upgrade variables to null.
MigrateActionConfigsTest class Drupal\Tests\action\Kernel\Migrate\d7 core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionConfigsTest.php Upgrade variables to null.
MigrateActionsTest class Drupal\Tests\action\Kernel\Migrate\d6 core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php Tests migration of action items.
MigrateActionsTest class Drupal\Tests\action\Kernel\Migrate\d7 core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php Tests migration of action items.
MigrateAggregatorConfigsTest class Drupal\Tests\aggregator\Kernel\Migrate\d6 core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorConfigsTest.php Upgrade variables to aggregator.settings.yml.
MigrateAggregatorFeedTest class Drupal\Tests\aggregator\Kernel\Migrate\d6 core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorFeedTest.php Tests migration of aggregator feeds.
MigrateAggregatorFeedTest class Drupal\Tests\aggregator\Kernel\Migrate\d7 core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php Test migration to aggregator_feed entities.
MigrateAggregatorItemTest class Drupal\Tests\aggregator\Kernel\Migrate\d6 core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorItemTest.php Tests migration of aggregator items.
MigrateAggregatorItemTest class Drupal\Tests\aggregator\Kernel\Migrate\d7 core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorItemTest.php Tests migration of aggregator items.
MigrateAggregatorSettingsTest class Drupal\Tests\aggregator\Kernel\Migrate\d7 core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorSettingsTest.php Tests migration of Aggregator's variables to configuration.
MigrateAggregatorStubTest class Drupal\Tests\aggregator\Kernel\Migrate core/modules/aggregator/tests/src/Kernel/Migrate/MigrateAggregatorStubTest.php Test stub creation for aggregator feeds and items.
MigrateBlockContentBodyFieldTest class Drupal\Tests\block_content\Kernel\Migrate core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php Attaches a body field to the custom block type.
MigrateBlockContentEntityDisplayTest class Drupal\Tests\block_content\Kernel\Migrate core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php Tests migration of block content body field display configuration.
MigrateBlockContentEntityFormDisplayTest class Drupal\Tests\block_content\Kernel\Migrate core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php Tests migration of block content body field form display configuration.
MigrateBlockContentStubTest class Drupal\Tests\block_content\Kernel\Migrate core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php Test stub creation for block_content entities.
MigrateBlockContentTest class Drupal\Tests\block_content\Kernel\Migrate\d6 core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php Upgrade custom blocks.
MigrateBlockContentTranslationTest class Drupal\Tests\block\Kernel\Migrate\d6 core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php Tests migration of i18n block translations.
MigrateBlockContentTranslationTest class Drupal\Tests\block\Kernel\Migrate\d7 core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php Tests migration of i18n block translations.
MigrateBlockContentTypeTest class Drupal\Tests\block_content\Kernel\Migrate core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php Tests migration of the basic block content type.
MigrateBlockedIpsTest class Drupal\Tests\ban\Kernel\Migrate\d7 core/modules/ban/tests/src/Kernel/Migrate/d7/MigrateBlockedIpsTest.php Migrate blocked IPs.

Other projects


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