Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
Fid class Drupal\file\Plugin\views\argument core/modules/file/src/Plugin/views/argument/Fid.php Argument handler to accept multiple file ids.
Field class Drupal\field\Plugin\migrate\source\d6 core/modules/field/src/Plugin/migrate/source/d6/Field.php Drupal 6 field source from database. 1 1
Field class Drupal\field\Plugin\migrate\source\d7 core/modules/field/src/Plugin/migrate/source/d7/Field.php Drupal 7 field source from database. 1 1
FieldableEntity abstract class Drupal\migrate_drupal\Plugin\migrate\source\d7 core/modules/migrate_drupal/src/Plugin/migrate/source/d7/FieldableEntity.php Base class for D7 source plugins which need to collect field values. 8 8
FieldableEntityDefinitionUpdateTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php Tests EntityDefinitionUpdateManager's fieldable entity update functionality.
FieldableEntityInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/FieldableEntityInterface.php Interface for entities having fields. 1 93 1
FieldableEntityNormalizerTrait trait Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php A trait for providing fieldable entity normalization/denormalization methods.
FieldableEntityStorageInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php A storage that supports entity types with field definitions. 1 3
FieldAccessTest class Drupal\Tests\field\Functional core/modules/field/tests/src/Functional/FieldAccessTest.php Tests Field access.
FieldAccessTest class Drupal\KernelTests\Core\Field core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php Tests Field level access hooks.
FieldApiDataTest class Drupal\Tests\views\Kernel core/modules/views/tests/src/Kernel/FieldApiDataTest.php Tests the Field Views data.
FieldAPIHandlerTrait trait Drupal\views core/modules/views/src/FieldAPIHandlerTrait.php A trait containing helper methods for field definitions. 8
FieldAttachOtherTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php Tests other Field API functions.
FieldAttachStorageTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php Tests storage-related Field Attach API functions.
FieldBlock class Drupal\layout_builder\Plugin\Block core/modules/layout_builder/src/Plugin/Block/FieldBlock.php Provides a block that renders a field from an entity. 1 3
FieldBlock class Drupal\layout_builder_field_block_test\Plugin\Block core/modules/layout_builder/tests/modules/layout_builder_field_block_test/src/Plugin/Block/FieldBlock.php Provides test field block to test with Block UI.
FieldBlockDeriver class Drupal\layout_builder\Plugin\Derivative core/modules/layout_builder/src/Plugin/Derivative/FieldBlockDeriver.php Provides entity field block definitions for every field. 2
FieldBlockDeriverTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/FieldBlockDeriverTest.php Tests field block plugin derivatives.
FieldBlockTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php Tests Drupal\layout_builder\Plugin\Block\FieldBlock.
FieldBlockTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php Tests Drupal\layout_builder\Plugin\Block\FieldBlock.
FieldBooleanTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php Tests the core Drupal\views\Plugin\views\field\Boolean handler.
FieldBundle

in drupal:11.3.0 and is removed from drupal:12.0.0. There is no replacement.

class Drupal\field\Plugin\migrate\process\d7 core/modules/field/src/Plugin/migrate/process/d7/FieldBundle.php Determines the bundle for a field.
FieldConfig class Drupal\field\Entity core/modules/field/src/Entity/FieldConfig.php Defines the Field entity. 345
FieldConfigAccessControlHandler class Drupal\field core/modules/field/src/FieldConfigAccessControlHandler.php Defines the access control handler for the field config entity type. 2
FieldConfigAccessControlHandlerTest class Drupal\Tests\field\Unit core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php Tests the field config access controller.
FieldConfigAddController final class Drupal\field_ui\Controller core/modules/field_ui/src/Controller/FieldConfigAddController.php Controller for building the field instance form. 1
FieldConfigBase abstract class Drupal\Core\Field core/lib/Drupal/Core/Field/FieldConfigBase.php Base class for configurable field definitions. 2 3
FieldConfigDeleteForm class Drupal\field_ui\Form core/modules/field_ui/src/Form/FieldConfigDeleteForm.php Provides a form for removing a field from a bundle.
FieldConfigEditForm class Drupal\field_ui\Form core/modules/field_ui/src/Form/FieldConfigEditForm.php Provides a form for the field settings form. 2
FieldConfigEditFormTest class Drupal\Tests\field_ui\Unit core/modules/field_ui/tests/src/Unit/FieldConfigEditFormTest.php Tests Drupal\field_ui\Form\FieldConfigEditForm.
FieldConfigEntityUnitTest class Drupal\Tests\field\Unit core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php Tests Drupal\field\Entity\FieldConfig.
FieldConfigInterface interface Drupal\field core/modules/field/src/FieldConfigInterface.php Provides an interface defining a field entity. 1 20
FieldConfigInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/FieldConfigInterface.php Defines an interface for configurable field definitions. 1 5
FieldConfigJsonAnonTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigJsonAnonTest.php Tests Field Config Json Anon.
FieldConfigJsonBasicAuthTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigJsonBasicAuthTest.php Tests Field Config Json Basic Auth.
FieldConfigJsonCookieTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigJsonCookieTest.php Tests Field Config Json Cookie.
FieldConfigListBuilder class Drupal\field_ui core/modules/field_ui/src/FieldConfigListBuilder.php Provides lists of field config entities.
FieldConfigListController class Drupal\field_ui\Controller core/modules/field_ui/src/Controller/FieldConfigListController.php Defines a controller to list field instances.
FieldConfigResourceTestBase abstract class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigResourceTestBase.php Resource test base for the FieldConfig entity. 6
FieldConfigStorage class Drupal\field core/modules/field/src/FieldConfigStorage.php Storage handler for field config. 1
FieldConfigStorageBase abstract class Drupal\Core\Field core/lib/Drupal/Core/Field/FieldConfigStorageBase.php Base storage class for field config entities. 2 1
FieldConfigTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/FieldConfigTest.php JSON:API integration test for the "FieldConfig" config entity type.
FieldConfigValidationTest class Drupal\Tests\field\Kernel\Entity core/modules/field/tests/src/Kernel/Entity/FieldConfigValidationTest.php Tests validation of field_config entities.
FieldConfigXmlAnonTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigXmlAnonTest.php Tests Field Config Xml Anon.
FieldConfigXmlBasicAuthTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigXmlBasicAuthTest.php Tests Field Config Xml Basic Auth.
FieldConfigXmlCookieTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigXmlCookieTest.php Tests Field Config Xml Cookie.
FieldCounterTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php Tests the Drupal\views\Plugin\views\field\Counter handler.
FieldCounterTest class Drupal\Tests\rest\Functional\Views core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php Tests the display of counter field.
FieldCrudTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/FieldCrudTest.php Create field entities by attaching fields to entities.
FieldCustomTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php Tests the core Drupal\views\Plugin\views\field\Custom handler.

Other projects


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