Classes, traits, and interfaces - 10.3.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 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
ValidateMigrationStateTest class Drupal\Tests\migrate_drupal\Kernel\d7 core/modules/migrate_drupal/tests/src/Kernel/d7/ValidateMigrationStateTest.php Tests the migration state information in module.migrate_drupal.yml.
ValidateMigrationStateTestTrait trait Drupal\Tests\migrate_drupal\Traits core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php Tests the migration state information in module.migrate_drupal.yml. 2
ValidationErrorBlock class Drupal\settings_tray_test\Plugin\Block core/modules/settings_tray/tests/modules/settings_tray_test/src/Plugin/Block/ValidationErrorBlock.php Provides a 'Block with validation error' test block.
ValidationTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/ValidationTest.php Tests form processing and alteration via form validation handlers.
ValidatorsTest class Drupal\Tests\ckeditor5\Kernel core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemConstraintValidator[[api-linebreak]] @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemDependencyConstraintValidator[[api-linebreak]] @covers…
ValidConsumer class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php
ValidConsumerWithExtraArguments class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php
ValidHandler class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php
ValidKeysConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ValidKeysConstraint.php Checks that all the keys of a mapping are valid and required keys present.
ValidKeysConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ValidKeysConstraintValidator.php Validates the ValidKeys constraint.
ValidKeysConstraintValidatorTest class Drupal\KernelTests\Core\TypedData core/tests/Drupal/KernelTests/Core/TypedData/ValidKeysConstraintValidatorTest.php Tests the ValidKeys validation constraint.
ValidPathConstraint class Drupal\Core\Path\Plugin\Validation\Constraint core/lib/Drupal/Core/Path/Plugin/Validation/Constraint/ValidPathConstraint.php Validation constraint for valid system paths.
ValidPathConstraintValidator class Drupal\Core\Path\Plugin\Validation\Constraint core/lib/Drupal/Core/Path/Plugin/Validation/Constraint/ValidPathConstraintValidator.php Constraint validator for validating system paths.
ValidReferenceConstraint class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraint.php Entity Reference valid reference constraint.
ValidReferenceConstraintValidator class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php Checks if referenced entities are valid.
ValidReferenceConstraintValidatorTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php Tests validation constraints for ValidReferenceConstraintValidator.
Value class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Value.php Provides a form element for storage of internal information.
Variable class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Variable.php Provides helpers for dealing with variables. 10
Variable class Drupal\migrate_drupal\Plugin\migrate\source core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php Drupal 6/7 variable source from database. 4 4
VariableMultiRow class Drupal\migrate_drupal\Plugin\migrate\source core/modules/migrate_drupal/src/Plugin/migrate/source/VariableMultiRow.php Drupal 6/7 multiple variables source from database. 1 1
VariableMultiRowTest class Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/VariableMultiRowTest.php Tests the variable multirow source plugin.
VariableTest class Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/VariableTest.php Tests the variable source plugin.
VariableTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/VariableTest.php Test variable export functionality in Variable component.
VariableTestMock class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/VariableTest.php
VariableTranslation class Drupal\migrate_drupal\Plugin\migrate\source\d6 core/modules/migrate_drupal/src/Plugin/migrate/source/d6/VariableTranslation.php Drupal 6 i18n_variable source from database.
VariableTranslation class Drupal\migrate_drupal\Plugin\migrate\source\d7 core/modules/migrate_drupal/src/Plugin/migrate/source/d7/VariableTranslation.php Drupal 7 variable_store source from database.
VariableTranslationCheckRequirementsTest class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/VariableTranslationCheckRequirementsTest.php Tests check requirements for variable translation source plugin.
VariableTranslationTest class Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\d6 core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/d6/VariableTranslationTest.php Tests the variable source plugin.
VariableTranslationTest class Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\d7 core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/d7/VariableTranslationTest.php Tests the variable source plugin.
VariantBase abstract class Drupal\Core\Display core/lib/Drupal/Core/Display/VariantBase.php Provides a base class for DisplayVariant plugins. 3 3
VariantInterface interface Drupal\Core\Display core/lib/Drupal/Core/Display/VariantInterface.php Provides an interface for DisplayVariant plugins. 3
VariantManager class Drupal\Core\Display core/lib/Drupal/Core/Display/VariantManager.php Manages discovery of display variant plugins. 2
VariationCache class Drupal\Core\Cache core/lib/Drupal/Core/Cache/VariationCache.php Wraps a regular cache backend to make it support cache contexts. 3
VariationCacheFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/VariationCacheFactory.php Defines the variation cache factory. 2
VariationCacheFactoryInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/VariationCacheFactoryInterface.php An interface defining variation cache factory classes. 1
VariationCacheInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/VariationCacheInterface.php Defines an interface for variation cache implementations. 1 4 7
VariationCacheTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php @coversDefaultClass \Drupal\Core\Cache\VariationCache[[api-linebreak]] @group Cache
VegetableInterface interface Drupal\Tests\Component\Plugin\Fixtures\vegetable core/tests/Drupal/Tests/Component/Plugin/Fixtures/vegetable/VegetableInterface.php Provides an interface for test plugins. 1 1
VendorHardeningPlugin class Drupal\Composer\Plugin\VendorHardening composer/Plugin/VendorHardening/VendorHardeningPlugin.php A Composer plugin to clean out your project's vendor directory. 1
VendorHardeningPluginTest class Drupal\Tests\Composer\Plugin\VendorHardening core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/VendorHardeningPluginTest.php @coversDefaultClass \Drupal\Composer\Plugin\VendorHardening\VendorHardeningPlugin[[api-linebreak]] @group VendorHardening
Version final class Drupal\Tests\Component\Annotation\Doctrine\Fixtures\Annotation core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/Annotation/Version.php Plugin annotation @Target("PROPERTY");
VersionById class Drupal\jsonapi\Revisions core/modules/jsonapi/src/Revisions/VersionById.php Defines a revision ID implementation for entity revision ID values. 1 2
VersionByRel class Drupal\jsonapi\Revisions core/modules/jsonapi/src/Revisions/VersionByRel.php Revision ID implementation for the default or latest revisions. 2 2
VersionHistoryController class Drupal\Core\Entity\Controller core/lib/Drupal/Core/Entity/Controller/VersionHistoryController.php Provides a controller showing revision history for an entity. 2
VersionHistoryLocalTasks class Drupal\Core\Entity\Plugin\Derivative core/lib/Drupal/Core/Entity/Plugin/Derivative/VersionHistoryLocalTasks.php Provides version history local tasks for revisionable entities. 1
VersionNegotiator class Drupal\jsonapi\Revisions core/modules/jsonapi/src/Revisions/VersionNegotiator.php Provides a version negotiator manager. 1 2
VersionNegotiatorInterface interface Drupal\jsonapi\Revisions core/modules/jsonapi/src/Revisions/VersionNegotiatorInterface.php Defines the common interface for all version negotiators. 2
VersionNegotiatorTest class Drupal\Tests\jsonapi\Kernel\Revisions core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php The test class for version negotiators.
VersionNotFoundException class Drupal\jsonapi\Revisions core/modules/jsonapi/src/Revisions/VersionNotFoundException.php Used when a version ID is valid, but the requested version does not exist.
VersionTest class Drupal\Tests\ckeditor5\Unit core/modules/ckeditor5/tests/src/Unit/VersionTest.php @group ckeditor5 @internal

Other projects


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