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
FileProcessBase abstract class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/FileProcessBase.php Provides functionality for file process plugins. 2
FileProcessOutputCallback final class Drupal\package_manager core/modules/package_manager/src/FileProcessOutputCallback.php Logs process output to a file. 3
FileReadOnlyStorage class Drupal\Component\PhpStorage core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php Reads code as regular PHP files, but won't write them. 1
FileReferenceResolver class Drupal\file core/modules/file/src/FileReferenceResolver.php Retrieves file references. 1
FileReferencesDeprecationTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/FileReferencesDeprecationTest.php Tests file_get_file_references().
FileReferenceUsage class Drupal\file core/modules/file/src/FileReferenceUsage.php Provides information which field on a given entity uses a file.
FileRepository class Drupal\file core/modules/file/src/FileRepository.php Provides a file entity repository. 4 2
FileRepositoryInterface interface Drupal\file core/modules/file/src/FileRepositoryInterface.php Performs file system operations and updates database records accordingly. 1 3
FileRepositoryTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/FileRepositoryTest.php Tests the FileRepository.
FileRequiredTestForm class Drupal\file_test\Form core/modules/file/tests/file_test/src/Form/FileRequiredTestForm.php File required test form class. 1
FileRequirements class Drupal\file\Hook core/modules/file/src/Hook/FileRequirements.php Requirements for the File module.
FileResourceTestBase abstract class Drupal\Tests\file\Functional\Rest core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php Resource test base for file entity. 6
FileRouteProvider class Drupal\file\Entity core/modules/file/src/Entity/FileRouteProvider.php Provides routes for files.
FileSanitizationEventSubscriber class Drupal\file_validator_test\EventSubscriber core/modules/file/tests/modules/file_validator_test/src/EventSubscriber/FileSanitizationEventSubscriber.php Provides a file sanitization listener for file upload tests. 2
FileSaveDataTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/FileSaveDataTest.php Tests the file_unmanaged_save_data() function. 1
FileSaveHtaccessLoggingTest class Drupal\Tests\system\Functional\File core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php Tests the log message added by the HtaccessWriter service.
FileSaveUploadTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/FileSaveUploadTest.php Tests file_save_upload().
FileSecurity class Drupal\Composer\Plugin\VendorHardening composer/Plugin/VendorHardening/FileSecurity.php Provides file security functions.
FileSecurity class Drupal\Component\FileSecurity core/lib/Drupal/Component/FileSecurity/FileSecurity.php Provides file security functions. 8
FileSecurityTest class Drupal\Tests\Component\FileSecurity core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php Tests the file security component.
FileSelection class Drupal\file\Plugin\EntityReferenceSelection core/modules/file/src/Plugin/EntityReferenceSelection/FileSelection.php Provides specific access control for the file entity type.
FileSelectionTest class Drupal\Tests\file\Kernel\Plugin\EntityReference core/modules/file/tests/src/Kernel/Plugin/EntityReference/FileSelectionTest.php Tests file selection plugin.
FileServiceProvider class Drupal\file core/modules/file/src/FileServiceProvider.php Adds 'application/octet-stream' as a known (bin) format.
FileSize class Drupal\file\Plugin\Field\FieldFormatter core/modules/file/src/Plugin/Field/FieldFormatter/FileSize.php Formatter that shows the file byte size in a human-readable way.
FileSize class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/FileSize.php Render a numeric value as a size.
FileSizeLimitConstraint class Drupal\file\Plugin\Validation\Constraint core/modules/file/src/Plugin/Validation/Constraint/FileSizeLimitConstraint.php File size max constraint.
FileSizeLimitConstraintValidator class Drupal\file\Plugin\Validation\Constraint core/modules/file/src/Plugin/Validation/Constraint/FileSizeLimitConstraintValidator.php Validates the FileSizeLimitConstraint. 1
FileSizeLimitConstraintValidatorTest class Drupal\Tests\file\Kernel\Plugin\Validation\Constraint core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileSizeLimitConstraintValidatorTest.php Tests the FileSizeLimitConstraintValidator.
FileStorage class Drupal\file core/modules/file/src/FileStorage.php File storage for files. 1
FileStorage class Drupal\Component\PhpStorage core/lib/Drupal/Component/PhpStorage/FileStorage.php Stores the code as regular PHP files. 1 2
FileStorage class Drupal\Core\Config core/lib/Drupal/Core/Config/FileStorage.php Defines the file storage. 1 20
FileStorageFactory

in drupal:11.5.0 and is removed from drupal:13.0.0. Use the "config.storage.sync" service instead.

class Drupal\Core\Config core/lib/Drupal/Core/Config/FileStorageFactory.php Provides a factory for creating config storage objects. 1
FileStorageFactoryTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/FileStorageFactoryTest.php Tests Drupal\Core\Config\FileStorageFactory.
FileStorageInterface interface Drupal\file core/modules/file/src/FileStorageInterface.php Defines an interface for file entity storage classes. 1
FileStorageReadOnlyTest class Drupal\Tests\Component\PhpStorage core/tests/Drupal/Tests/Component/PhpStorage/FileStorageReadOnlyTest.php Tests Drupal\Component\PhpStorage\FileReadOnlyStorage.
FileStorageSchema class Drupal\file core/modules/file/src/FileStorageSchema.php Defines the file schema handler. 1
FileStorageTest class Drupal\Tests\Component\PhpStorage core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php Tests Drupal\Component\PhpStorage\FileStorage.
FileStorageTest class Drupal\KernelTests\Core\Config\Storage core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php Tests FileStorage operations.
FileSystem class Drupal\Core\File core/lib/Drupal/Core/File/FileSystem.php Provides helpers to operate on files and stream wrappers. 8 2
FileSystem class Drupal\Component\FileSystem core/lib/Drupal/Component/FileSystem/FileSystem.php Provides file system functions. 13
FileSystemForm class Drupal\system\Form core/modules/system/src/Form/FileSystemForm.php Configure file system settings for this site. 1
FileSystemInterface interface Drupal\Core\File core/lib/Drupal/Core/File/FileSystemInterface.php Provides an interface for helpers that operate on files and stream wrappers. 1 86
FilesystemLoader class Drupal\Core\Template\Loader core/lib/Drupal/Core/Template/Loader/FilesystemLoader.php Loads templates from the filesystem. 2
FileSystemModuleDiscoveryDataProviderTrait trait Drupal\KernelTests core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php A trait used in testing for providing a list of modules in a dataProvider. 15
FileSystemRequirementsTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/FileSystemRequirementsTest.php Tests File System Requirements.
FileSystemTempDirectoryTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/FileSystemTempDirectoryTest.php Tests for getTempDirectory on FileSystem.
FileSystemTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php Tests Drupal\Core\File\FileSystem.
FileSystemTest class Drupal\Tests\Core\File core/tests/Drupal/Tests/Core/File/FileSystemTest.php Tests Drupal\Core\File\FileSystem.
FileTest class Drupal\Tests\file\Kernel\Plugin\migrate\source\d6 core/modules/file/tests/src/Kernel/Plugin/migrate/source/d6/FileTest.php Tests D6 file source plugin.
FileTest class Drupal\Tests\file\Kernel\Plugin\migrate\source\d7 core/modules/file/tests/src/Kernel/Plugin/migrate/source/d7/FileTest.php Tests D7 file source plugin.

Other projects


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