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
Extract class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/Extract.php Extracts a value from an array. 1
ExtractTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/ExtractTest.php @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\Extract[[api-linebreak]] @group migrate
ExtractTest class Drupal\Tests\migrate\Kernel\process core/modules/migrate/tests/src/Kernel/process/ExtractTest.php Tests the extract process plugin.
ExtraFieldBlock class Drupal\layout_builder\Plugin\Block core/modules/layout_builder/src/Plugin/Block/ExtraFieldBlock.php Provides a block that renders an extra field from an entity. 1
ExtraFieldBlockCacheTagInvalidator class Drupal\layout_builder\Cache core/modules/layout_builder/src/Cache/ExtraFieldBlockCacheTagInvalidator.php Provides a cache tag invalidator that clears the block cache. 2
ExtraFieldBlockDeriver class Drupal\layout_builder\Plugin\Derivative core/modules/layout_builder/src/Plugin/Derivative/ExtraFieldBlockDeriver.php Provides entity field block definitions for every field. 1
FactoryInterface interface Drupal\Component\Plugin\Factory core/lib/Drupal/Component/Plugin/Factory/FactoryInterface.php Factory interface implemented by all plugin factories. 2 3
FactoryTest class Drupal\KernelTests\Core\Plugin core/tests/Drupal/KernelTests/Core/Plugin/FactoryTest.php Tests that plugins are correctly instantiated.
Failing class Drupal\image_test\Plugin\ImageToolkit\Operation\test core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/Failing.php An image toolkit operation that throws a \RuntimeException.
FakeAutoloader class Drupal\Tests\Core\DrupalKernel core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php A fake autoloader for testing.
FakeLogEntries trait Drupal\Tests\dblog\Functional core/modules/dblog/tests/src/Functional/FakeLogEntries.php Provides methods to generate log entries. 1
FakeRecord class Drupal\Tests\system\Functional\Database core/modules/system/tests/src/Functional/Database/FakeRecord.php Fetches into a class. 2
FakeViewModeContext class Drupal\layout_builder_fieldblock_test\ContextProvider core/modules/layout_builder/tests/modules/layout_builder_fieldblock_test/src/ContextProvider/FakeViewModeContext.php Provides a global context for view_mode for testing purposes. 2
FallbackFieldTypeCategory class Drupal\Core\Field core/lib/Drupal/Core/Field/FallbackFieldTypeCategory.php Fallback plugin class for FieldTypeCategoryManager. 1 1
FallbackPluginManagerInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/FallbackPluginManagerInterface.php An interface implemented by plugin managers with fallback plugin behaviors. 6 8
FalseContentResponse class Drupal\Tests\Core\StackMiddleware core/tests/Drupal/Tests/Core/StackMiddleware/ContentLengthTest.php Response that returns FALSE from ::getContent().
Fast404ExceptionHtmlSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php High-performance 404 exception subscriber. 2
Fast404Test class Drupal\FunctionalTests\EventSubscriber core/tests/Drupal/FunctionalTests/EventSubscriber/Fast404Test.php Tests the fast 404 functionality.
FastTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/FastTest.php Tests autocompletion not loading registry.
FavoriteAnimalTestForm class Drupal\block_test\Form core/modules/block/tests/modules/block_test/src/Form/FavoriteAnimalTestForm.php Form that performs favorite animal test.
Feed class Drupal\views\Plugin\views\display core/modules/views/src/Plugin/views/display/Feed.php The plugin that handles a feed, such as RSS or atom.
FetchModeTrait trait Drupal\Core\Database core/lib/Drupal/Core/Database/FetchModeTrait.php Provide helper methods for statement fetching.
FetchTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/FetchTest.php Tests the Database system's various fetch capabilities.
FiberPlaceholderTest class Drupal\Tests\big_pipe\Unit\Render core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php @coversDefaultClass \Drupal\big_pipe\Render\BigPipe[[api-linebreak]] @group big_pipe
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
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
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 90
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\KernelTests\Core\Field core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php Tests Field level access hooks.
FieldAccessTest class Drupal\Tests\field\Functional core/modules/field/tests/src/Functional/FieldAccessTest.php Tests Field access.
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. 7
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 2
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. 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 @coversDefaultClass \Drupal\layout_builder\Plugin\Block\FieldBlock[[api-linebreak]]
FieldBlockTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php @coversDefaultClass \Drupal\layout_builder\Plugin\Block\FieldBlock[[api-linebreak]] @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. 323
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.
FieldConfigAddController final class Drupal\field_ui\Controller core/modules/field_ui/src/Controller/FieldConfigAddController.php Controller for building the field instance form. 1

Other projects


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