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
FieldUITest class Drupal\Tests\field\Functional\Views core/modules/field/tests/src/Functional/Views/FieldUITest.php Tests the UI of the field handler.
FieldUiTestTrait trait Drupal\Tests\field_ui\Traits core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php Provides common functionality for the Field UI test classes. 10
FieldUninstallValidator class Drupal\field\ProxyClass core/modules/field/src/ProxyClass/FieldUninstallValidator.php Provides a proxy class for \Drupal\field\FieldUninstallValidator.
FieldUninstallValidator class Drupal\field core/modules/field/src/FieldUninstallValidator.php Prevents uninstallation of modules providing active field storage. 2
FieldUninstallValidatorTest class Drupal\Tests\field\Unit core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php @coversDefaultClass \Drupal\field\FieldUninstallValidator @group field
FieldUpdateActionBase abstract class Drupal\Core\Field core/lib/Drupal/Core/Field/FieldUpdateActionBase.php Provides a base for action plugins that update one or more fields. 4 4
FieldUrlTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php Tests the core Drupal\views\Plugin\views\field\Url handler.
FieldValidationTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/FieldValidationTest.php Tests field validation.
FieldWebTest class Drupal\Tests\views\Functional\Handler core/modules/views/tests/src/Functional/Handler/FieldWebTest.php Tests fields from within a UI.
FieldWidget class Drupal\Core\Field\Annotation core/lib/Drupal/Core/Field/Annotation/FieldWidget.php Defines a FieldWidget annotation object.
FieldWidgetConstraint class Drupal\entity_test\Plugin\Validation\Constraint core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraint.php Supports validating widget constraints.
FieldWidgetConstraintValidator class Drupal\entity_test\Plugin\Validation\Constraint core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraintValidator.php Validates the FieldWidgetConstraint constraint.
FieldWidgetConstraintValidatorTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php Tests validation constraints for FieldWidgetConstraintValidatorTest.
File class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/File.php Provides a form element for uploading a file.
File class Drupal\media\Plugin\media\Source core/modules/media/src/Plugin/media/Source/File.php File entity media source. 3 2
File class Drupal\file\Entity core/modules/file/src/Entity/File.php Defines the file entity class. 114
File class Drupal\file\Plugin\views\field core/modules/file/src/Plugin/views/field/File.php Field handler to provide simple renderer that allows linking to a file.
File class Drupal\file\Plugin\views\wizard core/modules/file/src/Plugin/views/wizard/File.php Tests creating managed files views with the wizard.
File class Drupal\file\Plugin\migrate\source\d6 core/modules/file/src/Plugin/migrate/source/d6/File.php Drupal 6 file source from database.
File class Drupal\file\Plugin\migrate\source\d7 core/modules/file/src/Plugin/migrate/source/d7/File.php Drupal 7 file source from database. 1 1
FileAccessControlHandler class Drupal\file core/modules/file/src/FileAccessControlHandler.php Provides a File access control handler. 1 1
FileAccessFormatterControlHandlerInterface interface Drupal\file core/modules/file/src/FileAccessFormatterControlHandlerInterface.php Defines an interface for file access handlers that need to run on file formatters. 1 1
FileAudioFormatter class Drupal\file\Plugin\Field\FieldFormatter core/modules/file/src/Plugin/Field/FieldFormatter/FileAudioFormatter.php Plugin implementation of the 'file_audio' formatter.
FileAudioFormatterTest class Drupal\Tests\file\Functional\Formatter core/modules/file/tests/src/Functional/Formatter/FileAudioFormatterTest.php @coversDefaultClass \Drupal\file\Plugin\Field\FieldFormatter\FileAudioFormatter @group file
FileCache class Drupal\Component\FileCache core/lib/Drupal/Component/FileCache/FileCache.php Allows to cache data based on file modification dates. 3
FileCacheBackendInterface interface Drupal\Component\FileCache core/lib/Drupal/Component/FileCache/FileCacheBackendInterface.php Defines an interface inspired by APCu for FileCache backends. 2 1
FileCacheFactory class Drupal\Component\FileCache core/lib/Drupal/Component/FileCache/FileCacheFactory.php Creates a FileCache object. 21
FileCacheFactoryTest class Drupal\Tests\Component\FileCache core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php @coversDefaultClass \Drupal\Component\FileCache\FileCacheFactory @group FileCache
FileCacheInterface interface Drupal\Component\FileCache core/lib/Drupal/Component/FileCache/FileCacheInterface.php Interface for objects that allow caching file data. 2
FileCacheTest class Drupal\Tests\Component\FileCache core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php @coversDefaultClass \Drupal\Component\FileCache\FileCache @group FileCache
FileCopy class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/FileCopy.php Copies or moves a local file from one place into another. 1 2
FileCopyTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/FileCopyTest.php Tests the file copy process plugin.
FileCopyTest class Drupal\Tests\migrate\Kernel\process core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php Tests the file_copy process plugin.
FileCopyTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php Tests the unmanaged file copy function. 1
FileDeleteRecursiveTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php Tests the unmanaged file delete recursive function. 1
FileDeleteTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php Tests the unmanaged file delete function. 1
FileDownloadController class Drupal\system core/modules/system/src/FileDownloadController.php System file controller. 1 2
FileElementTest class Drupal\Tests\system\Kernel\Form core/modules/system/tests/src/Kernel/Form/FileElementTest.php Tests for the 'file' form element.
FileEntityFormatterTest class Drupal\Tests\file\Kernel\Formatter core/modules/file/tests/src/Kernel/Formatter/FileEntityFormatterTest.php Tests the default file formatter.
FileEntityNormalizer class Drupal\hal\Normalizer core/modules/hal/src/Normalizer/FileEntityNormalizer.php Converts the Drupal entity object structure to a HAL array structure. 2
FileException class Drupal\Core\File\Exception core/lib/Drupal/Core/File/Exception/FileException.php Base class for exceptions related to file handling operations. 7 30
FileExistsException class Drupal\Core\File\Exception core/lib/Drupal/Core/File/Exception/FileExistsException.php Exception thrown when a file unexpectedly exists. 8
FileExtensionFormatter class Drupal\file\Plugin\Field\FieldFormatter core/modules/file/src/Plugin/Field/FieldFormatter/FileExtensionFormatter.php Formatter to render a filename as file extension.
FileField class Drupal\file\Plugin\migrate\field\d6 core/modules/file/src/Plugin/migrate/field/d6/FileField.php Plugin annotation @MigrateField( id = "filefield", core = {6}, source_module = "filefield", destination_module = "file" ) 2 3
FileField class Drupal\file\Plugin\migrate\field\d7 core/modules/file/src/Plugin/migrate/field/d7/FileField.php Plugin annotation @MigrateField( id = "file", core = {7}, source_module = "file", destination_module = "file" ) 1
FileFieldAnonymousSubmissionTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php Confirm that file field submissions work correctly for anonymous visitors.
FileFieldAttributesTest class Drupal\Tests\rdf\Functional core/modules/rdf/tests/src/Functional/FileFieldAttributesTest.php Tests the RDFa markup of filefields.
FileFieldCreationTrait trait Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldCreationTrait.php Provides methods for creating file fields. 6
FileFieldDisplayTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldDisplayTest.php Tests the display of file fields in node and views.
FileFieldFileExtensionsUpdateTest class Drupal\Tests\file\Functional\Update core/modules/file/tests/src/Functional/Update/FileFieldFileExtensionsUpdateTest.php Tests file_post_update_add_txt_if_allows_insecure_extensions().

Other projects


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