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
FieldBlock class Drupal\layout_builder_fieldblock_test\Plugin\Block core/modules/layout_builder/tests/modules/layout_builder_fieldblock_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.
FieldBlockTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php @coversDefaultClass \Drupal\layout_builder\Plugin\Block\FieldBlock
FieldBlockTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php @coversDefaultClass \Drupal\layout_builder\Plugin\Block\FieldBlock @group Field
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 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. 303
FieldConfigAccessControlHandler class Drupal\field core/modules/field/src/FieldConfigAccessControlHandler.php Defines the access control handler for the field config entity type. 1
FieldConfigAccessControlHandlerTest class Drupal\Tests\field\Unit core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php Tests the field config access controller.
FieldConfigBase abstract class Drupal\Core\Field core/lib/Drupal/Core/Field/FieldConfigBase.php Base class for configurable field definitions. 2 2
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.
FieldConfigEntityUnitTest class Drupal\Tests\field\Unit core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php @coversDefaultClass \Drupal\field\Entity\FieldConfig @group field
FieldConfigHalJsonAnonTest class Drupal\Tests\hal\Functional\field core/modules/hal/tests/src/Functional/field/FieldConfigHalJsonAnonTest.php @group hal @group legacy
FieldConfigHalJsonBasicAuthTest class Drupal\Tests\hal\Functional\field core/modules/hal/tests/src/Functional/field/FieldConfigHalJsonBasicAuthTest.php @group hal @group legacy
FieldConfigHalJsonCookieTest class Drupal\Tests\hal\Functional\field core/modules/hal/tests/src/Functional/field/FieldConfigHalJsonCookieTest.php @group hal @group legacy
FieldConfigInterface interface Drupal\field core/modules/field/src/FieldConfigInterface.php Provides an interface defining a field entity. 1 16
FieldConfigInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/FieldConfigInterface.php Defines an interface for configurable field definitions. 1 3
FieldConfigJsonAnonTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigJsonAnonTest.php @group rest
FieldConfigJsonBasicAuthTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigJsonBasicAuthTest.php @group rest
FieldConfigJsonCookieTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigJsonCookieTest.php @group rest
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 9 3
FieldConfigStorage class Drupal\field core/modules/field/src/FieldConfigStorage.php Storage handler for field config.
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.
FieldConfigXmlAnonTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigXmlAnonTest.php @group rest
FieldConfigXmlBasicAuthTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigXmlBasicAuthTest.php @group rest
FieldConfigXmlCookieTest class Drupal\Tests\field\Functional\Rest core/modules/field/tests/src/Functional/Rest/FieldConfigXmlCookieTest.php @group rest
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.
FieldDataCountTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/FieldDataCountTest.php Tests the count of field data records.
FieldDateTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php Tests the core Drupal\views\Plugin\views\field\Date handler.
FieldDefaultValueCallbackProvider class Drupal\field_test core/modules/field/tests/modules/field_test/src/FieldDefaultValueCallbackProvider.php Helper class for \Drupal\Tests\field\Functional\FieldDefaultValueCallbackTest.
FieldDefaultValueCallbackTest class Drupal\Tests\field\Functional core/modules/field/tests/src/Functional/FieldDefaultValueCallbackTest.php Tests the default value callback.
FieldDefinition class Drupal\Core\Field core/lib/Drupal/Core/Field/FieldDefinition.php A class for defining entity field definitions. 4
FieldDefinitionIntegrityTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/FieldDefinitionIntegrityTest.php Tests the integrity of field API plugin definitions.
FieldDefinitionInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/FieldDefinitionInterface.php Defines an interface for entity field definitions. 5 132
FieldDefinitionListener class Drupal\Core\Field core/lib/Drupal/Core/Field/FieldDefinitionListener.php Reacts to field definition CRUD on behalf of the Entity system. 1 2
FieldDefinitionListenerInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/FieldDefinitionListenerInterface.php Defines an interface for reacting to field creation, deletion, and updates. 2 1
FieldDefinitionListenerTest class Drupal\Tests\Core\Field core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php @coversDefaultClass \Drupal\Core\Field\FieldDefinitionListener @group Field
FieldDefinitionTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php Unit test for the FieldDefinition class.
FieldDiscovery class Drupal\migrate_drupal core/modules/migrate_drupal/src/FieldDiscovery.php Provides field discovery for Drupal 6 & 7 migrations. 1 1 2
FieldDiscoveryInterface interface Drupal\migrate_drupal core/modules/migrate_drupal/src/FieldDiscoveryInterface.php Provides field discovery for Drupal 6 & 7 migrations. 1 8
FieldDiscoveryTest class Drupal\Tests\migrate_drupal\Unit core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php Tests the FieldDiscovery Class.
FieldDiscoveryTest class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php Tests FieldDiscovery service against Drupal 6.
FieldDiscoveryTest class Drupal\Tests\migrate_drupal\Kernel\d7 core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php Test FieldDiscovery Service against Drupal 7.

Other projects


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