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
FieldKernelTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php Tests the generic field handler.
FieldKernelTestBase abstract class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/FieldKernelTestBase.php Parent class for Field API unit tests. 42 20
FieldLabelDescriptionTranslation class Drupal\field\Plugin\migrate\source\d6 core/modules/field/src/Plugin/migrate/source/d6/FieldLabelDescriptionTranslation.php Gets field label and description translations.
FieldLabelDescriptionTranslation class Drupal\field\Plugin\migrate\source\d7 core/modules/field/src/Plugin/migrate/source/d7/FieldLabelDescriptionTranslation.php Gets field label and description translations.
FieldLanguageTest class Drupal\Tests\language\Kernel\Views core/modules/language/tests/src/Kernel/Views/FieldLanguageTest.php Tests the field language handler.
FieldLayoutBuilder class Drupal\field_layout core/modules/field_layout/src/FieldLayoutBuilder.php Builds a field layout. 2
FieldLayoutBuilderTest class Drupal\Tests\field_layout\Unit core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php @coversDefaultClass \Drupal\field_layout\FieldLayoutBuilder @group field_layout
FieldLayoutEntityDisplayFormTrait trait Drupal\field_layout\Form core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php Provides shared code for entity display forms.
FieldLayoutEntityDisplayTest class Drupal\Tests\field_layout\Kernel core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php @coversDefaultClass \Drupal\field_layout\Entity\FieldLayoutEntityDisplayTrait @group field_layout
FieldLayoutEntityDisplayTrait trait Drupal\field_layout\Entity core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php Provides shared code for entity displays.
FieldLayoutEntityFormDisplay class Drupal\field_layout\Entity core/modules/field_layout/src/Entity/FieldLayoutEntityFormDisplay.php Provides an entity form display entity that has a layout. 1
FieldLayoutEntityFormDisplayEditForm class Drupal\field_layout\Form core/modules/field_layout/src/Form/FieldLayoutEntityFormDisplayEditForm.php Edit form for the EntityFormDisplay entity type. 1
FieldLayoutEntityViewDisplay class Drupal\field_layout\Entity core/modules/field_layout/src/Entity/FieldLayoutEntityViewDisplay.php Provides an entity view display entity that has a layout. 2
FieldLayoutEntityViewDisplayEditForm class Drupal\field_layout\Form core/modules/field_layout/src/Form/FieldLayoutEntityViewDisplayEditForm.php Edit form for the EntityViewDisplay entity type. 1
FieldLayoutTest class Drupal\Tests\field_layout\FunctionalJavascript core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php Tests using field layout for entity displays.
FieldLayoutTest class Drupal\Tests\field_layout\Functional core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php Tests using field layout for entity displays.
FieldLayoutUninstallTest class Drupal\Tests\field_layout\Kernel core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php @group field_layout
FieldLeft class Drupal\migrate_state_active_test\Plugin\migrate\field\d7 core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/src/Plugin/migrate/field/FieldLeft.php Field migration for testing migration states.
FieldLink class Drupal\link\Plugin\migrate\process core/modules/link/src/Plugin/migrate/process/FieldLink.php Transform a pre-Drupal 8 formatted link for use in Drupal 8. 2 3
FieldLink

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\link\Plugin\migrate\process\FieldLink instead.

class Drupal\link\Plugin\migrate\process\d6 core/modules/link/src/Plugin/migrate/process/d6/FieldLink.php Plugin annotation @MigrateProcessPlugin( id = "d6_field_link" ) 1
FieldLinkTest class Drupal\Tests\link\Unit\Plugin\migrate\process core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php @group Link
FieldLinkTest class Drupal\Tests\link\Unit\Plugin\migrate\process\d6 core/modules/link/tests/src/Unit/Plugin/migrate/process/d6/FieldLinkTest.php @group Link @group legacy
FieldMigration class Drupal\migrate_drupal\Plugin\migrate core/modules/migrate_drupal/src/Plugin/migrate/FieldMigration.php Migration plugin class for migrations dealing with field config and values. 3 2 9
FieldMissingTypeTest class Drupal\KernelTests\Core\Field core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php Tests the exception when missing a field type.
FieldNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/FieldNormalizer.php Converts the Drupal field structure to a JSON:API array structure. 1 2
FieldNormalizer class Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/FieldNormalizer.php Denormalizes data to Drupal field values. 1 1 2
FieldNormalizer class Drupal\hal\Normalizer core/modules/hal/src/Normalizer/FieldNormalizer.php Converts the Drupal field structure to HAL array structure. 1 2
FieldNormalizerDenormalizeExceptionsUnitTest class Drupal\Tests\hal\Unit core/modules/hal/tests/src/Unit/FieldNormalizerDenormalizeExceptionsUnitTest.php @coversDefaultClass \Drupal\hal\Normalizer\FieldNormalizer @group hal
FieldNumericTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/FieldNumericTest.php Tests the core Drupal\views\Plugin\views\field\Numeric handler.
FieldOptionTranslation class Drupal\field\Plugin\migrate\source\d6 core/modules/field/src/Plugin/migrate/source/d6/FieldOptionTranslation.php Gets field option label translations. 1
FieldOptionTranslation class Drupal\field\Plugin\migrate\source\d7 core/modules/field/src/Plugin/migrate/source/d7/FieldOptionTranslation.php Gets field option label translations.
FieldOptionTranslation class Drupal\field\Plugin\migrate\process\d6 core/modules/field/src/Plugin/migrate/process/d6/FieldOptionTranslation.php Determines the allowed values translation for select lists.
FieldOptionTranslation class Drupal\field\Plugin\migrate\process\d7 core/modules/field/src/Plugin/migrate/process/d7/FieldOptionTranslation.php Determines the allowed values translation for select lists.
FieldOptionTranslationTest class Drupal\Tests\field\Kernel\Plugin\migrate\source\d6 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldOptionTranslationTest.php Tests the field option translation source plugin. 1
FieldOptionTranslationTest class Drupal\Tests\field\Kernel\Plugin\migrate\source\d7 core/modules/field/tests/src/Kernel/Plugin/migrate/source/d7/FieldOptionTranslationTest.php Tests the field option translation source plugin.
FieldOrLanguageJoin class Drupal\views\Plugin\views\join core/modules/views/src/Plugin/views/join/FieldOrLanguageJoin.php Implementation for the "field OR language" join. 1
FieldOrLanguageJoinTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php Tests the "field OR language" join plugin.
FieldPluginBase abstract class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/FieldPluginBase.php Base class for views fields. 35 14
FieldPluginBase abstract class Drupal\migrate_drupal\Plugin\migrate\field core/modules/migrate_drupal/src/Plugin/migrate/field/FieldPluginBase.php The base class for all field plugins. 22 20
FieldPluginBaseTest class Drupal\Tests\views\Unit\Plugin\field core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php @coversDefaultClass \Drupal\views\Plugin\views\field\FieldPluginBase @group views
FieldPluginBaseTestField class Drupal\Tests\views\Unit\Plugin\field core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
FieldRdfaDatatypeCallbackTest class Drupal\Tests\rdf\Kernel\Field core/modules/rdf/tests/src/Kernel/Field/FieldRdfaDatatypeCallbackTest.php Tests the RDFa output of a text field formatter with a datatype callback.
FieldRdfaTestBase abstract class Drupal\Tests\rdf\Kernel\Field core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php 9
FieldRenderedEntityTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php Tests the core Drupal\views\Plugin\views\field\RenderedEntity handler.
FieldRenderedEntityTranslationTest class Drupal\Tests\views\Functional\Entity core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php Tests the rendering of the 'rendered_entity' field and translations.
FieldResolver class Drupal\jsonapi\Context core/modules/jsonapi/src/Context/FieldResolver.php A service that evaluates external path expressions against Drupal fields. 5 2
FieldResolverTest class Drupal\Tests\jsonapi\Kernel\Context core/modules/jsonapi/tests/src/Kernel/Context/FieldResolverTest.php @coversDefaultClass \Drupal\jsonapi\Context\FieldResolver @group jsonapi
FieldRight class Drupal\migrate_state_active_test\Plugin\migrate\field\d7 core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/src/Plugin/migrate/field/FieldRight.php Field migration for testing migration states.
Fields class Drupal\views\Plugin\views\row core/modules/views/src/Plugin/views/row/Fields.php The basic 'fields' row plugin 1 2
FieldSchemaDataUninstallUpdateTest class Drupal\Tests\system\Functional\Update core/modules/system/tests/src/Functional/Update/FieldSchemaDataUninstallUpdateTest.php Tests the upgrade path after fixing field schema data uninstallation.

Other projects


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