Classes, traits, and interfaces - 9.5.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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
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. 2
MessengerInterface interface Drupal\Core\Messenger core/lib/Drupal/Core/Messenger/MessengerInterface.php Stores runtime messages sent out to individual users on the page. 1 50
MessengerTest class Drupal\KernelTests\Core\Messenger core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php @group Messenger @coversDefaultClass \Drupal\Core\Messenger\Messenger[[api-linebreak]]
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. 3 2
MetadataBagTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/MetadataBagTest.php @coversDefaultClass \Drupal\Core\Session\MetadataBag[[api-linebreak]] @group Session
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[[api-linebreak]] @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\system\Kernel\Migrate\d6 core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php Upgrade variables to null.
MigrateActionConfigsTest class Drupal\Tests\system\Kernel\Migrate\d7 core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionConfigsTest.php Upgrade variables to null.
MigrateActionsTest class Drupal\Tests\system\Kernel\Migrate\d6 core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php Tests migration of action items.
MigrateActionsTest class Drupal\Tests\system\Kernel\Migrate\d7 core/modules/system/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.
MigrateBlockTest class Drupal\Tests\block\Kernel\Migrate\d6 core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php Tests migration of blocks to configuration entities.
MigrateBlockTest class Drupal\Tests\block\Kernel\Migrate\d7 core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php Tests migration of blocks to configuration entities.
MigrateBlockTest class Drupal\Tests\aggregator\Kernel\Migrate\d6 core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php Tests migration of aggregator block.
MigrateBookConfigsTest class Drupal\Tests\book\Kernel\Migrate\d6 core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookConfigsTest.php Upgrade variables to book.settings.yml.
MigrateBookConfigsTest class Drupal\Tests\book\Kernel\Migrate\d7 core/modules/book/tests/src/Kernel/Migrate/d7/MigrateBookConfigsTest.php Tests the migration of Book settings.
MigrateBookTest class Drupal\Tests\book\Kernel\Migrate\d6 core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookTest.php Upgrade book structure.
MigrateBookTest class Drupal\Tests\book\Kernel\Migrate\d7 core/modules/book/tests/src/Kernel/Migrate/d7/MigrateBookTest.php Tests migration of book structures from Drupal 7.
MigrateBuildDependencyInterface interface Drupal\migrate core/modules/migrate/src/MigrateBuildDependencyInterface.php 1 1
MigrateBundleTest class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php Tests setting of bundles on content entity migrations.
MigrateColorTest class Drupal\Tests\color\Kernel\Migrate\d7 core/modules/color/tests/src/Kernel/Migrate/d7/MigrateColorTest.php Tests migration of Color variables to configuration.

Other projects


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