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
FileFieldFormatterAccessTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php Tests file formatter access. @group file
FileFieldItemList class Drupal\file\Plugin\Field\FieldType core/modules/file/src/Plugin/Field/FieldType/FileFieldItemList.php Represents a configurable entity file field. 2
FileFieldPathTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldPathTest.php Tests that files are uploaded to proper locations.
FileFieldRevisionTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldRevisionTest.php Tests creating and deleting revisions with files attached.
FileFieldRSSContentTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php Ensure that files added to nodes appear correctly in RSS feeds.
FileFieldTest class Drupal\Tests\file\Unit\Plugin\migrate\field\d6 core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php @coversDefaultClass \Drupal\file\Plugin\migrate\field\d6\FileField @group file
FileFieldTest class Drupal\Tests\file\Unit\Plugin\migrate\field\d7 core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php @coversDefaultClass \Drupal\file\Plugin\migrate\field\d7\FileField @group file
FileFieldTestBase abstract class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldTestBase.php Provides methods specifically for testing File module's field handling. 15 1
FileFieldValidateTest class Drupal\Tests\file\FunctionalJavascript core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php Tests file field validation functions.
FileFieldValidateTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldValidateTest.php Tests file field validation functions.
FileFieldWidgetTest class Drupal\Tests\file\FunctionalJavascript core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php Tests the file field widget, single and multi-valued, using AJAX upload.
FileFieldWidgetTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileFieldWidgetTest.php Tests the file field widget with public and private files.
FileFormatterBase abstract class Drupal\file\Plugin\Field\FieldFormatter core/modules/file/src/Plugin/Field/FieldFormatter/FileFormatterBase.php Base class for file formatters. 5 1
FileHalJsonAnonTest class Drupal\Tests\hal\Functional\file core/modules/hal/tests/src/Functional/file/FileHalJsonAnonTest.php @group hal @group legacy 2
FileHalJsonBasicAuthTest class Drupal\Tests\hal\Functional\file core/modules/hal/tests/src/Functional/file/FileHalJsonBasicAuthTest.php @group hal @group legacy
FileHalJsonCookieTest class Drupal\Tests\hal\Functional\file core/modules/hal/tests/src/Functional/file/FileHalJsonCookieTest.php @group hal @group legacy
FileInterface interface Drupal\file core/modules/file/src/FileInterface.php Defines getter and setter methods for file entity base fields. 1 36
FileItem class Drupal\file\Plugin\Field\FieldType core/modules/file/src/Plugin/Field/FieldType/FileItem.php Plugin implementation of the 'file' field type. 1 4
FileItemTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/FileItemTest.php Tests using entity fields of the file field type.
FileItemValidationTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/FileItemValidationTest.php Tests that files referenced in file and image fields are always validated.
FileJsonAnonTest class Drupal\Tests\file\Functional\Rest core/modules/file/tests/src/Functional/Rest/FileJsonAnonTest.php @group rest
FileJsonBasicAuthTest class Drupal\Tests\file\Functional\Rest core/modules/file/tests/src/Functional/Rest/FileJsonBasicAuthTest.php @group rest
FileJsonCookieTest class Drupal\Tests\file\Functional\Rest core/modules/file/tests/src/Functional/Rest/FileJsonCookieTest.php @group rest
FileListingTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileListingTest.php Tests file listing page functionality.
FileManagedAccessTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/FileManagedAccessTest.php Tests access to managed files.
FileManagedFileElementTest class Drupal\Tests\file\FunctionalJavascript core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php Tests the 'managed_file' element type.
FileManagedFileElementTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileManagedFileElementTest.php Tests the 'managed_file' element type.
FileManagedTestBase abstract class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileManagedTestBase.php Provides a base class for testing files with the file_test module. 3
FileManagedUnitTestBase abstract class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php Provides a base class for testing file uploads and hook invocations. 14
FileMediaFormatterBase abstract class Drupal\file\Plugin\Field\FieldFormatter core/modules/file/src/Plugin/Field/FieldFormatter/FileMediaFormatterBase.php Base class for media file formatter. 2
FileMediaFormatterInterface interface Drupal\file\Plugin\Field\FieldFormatter core/modules/file/src/Plugin/Field/FieldFormatter/FileMediaFormatterInterface.php Defines getter methods for FileMediaFormatterBase. 1
FileMediaFormatterTestBase abstract class Drupal\Tests\file\Functional\Formatter core/modules/file/tests/src/Functional/Formatter/FileMediaFormatterTestBase.php Provides methods specifically for testing File module's media formatter's. 2
FileMigrationSetupTrait trait Drupal\Tests\file\Kernel\Migrate\d7 core/modules/file/tests/src/Kernel/Migrate/d7/FileMigrationSetupTrait.php A trait to setup the file migration. 4
FileMigrationTestTrait trait Drupal\Tests\file\Kernel\Migrate\d6 core/modules/file/tests/src/Kernel/Migrate/d6/FileMigrationTestTrait.php Helper for setting up a file migration test. 5
FilemimeFormatter class Drupal\file\Plugin\Field\FieldFormatter core/modules/file/src/Plugin/Field/FieldFormatter/FilemimeFormatter.php Formatter to render the file MIME type, with an optional icon.
FileModuleTestForm class Drupal\file_module_test\Form core/modules/file/tests/file_module_test/src/Form/FileModuleTestForm.php Form controller for file_module_test module. 1
FileMoveTest class Drupal\Tests\image\Functional core/modules/image/tests/src/Functional/FileMoveTest.php Tests the file move function for images and image styles.
FileMoveTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php Tests the unmanaged file move function. 1
FileNormalizeTest class Drupal\Tests\hal\Kernel core/modules/hal/tests/src/Kernel/FileNormalizeTest.php Tests that file entities can be normalized in HAL.
FileNotExistsException class Drupal\Core\File\Exception core/lib/Drupal/Core/File/Exception/FileNotExistsException.php Exception thrown when a file is expected to exist but does not. 4
FileOnTranslatedEntityTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php Uploads files to translated nodes.
FilePathTest class Drupal\Tests\migrate_drupal_ui\Functional\d7 core/modules/migrate_drupal_ui/tests/src/Functional/d7/FilePathTest.php Tests the Drupal 7 public and private file migrations.
FilePrivateTest class Drupal\Tests\file\Functional core/modules/file/tests/src/Functional/FilePrivateTest.php Uploads a test to a private node and checks access.
FileProcessBase abstract class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/FileProcessBase.php Provides functionality for file process plugins. 2
FileReadOnlyStorage class Drupal\Component\PhpStorage core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php Reads code as regular PHP files, but won't write them. 1
FileRepository class Drupal\file core/modules/file/src/FileRepository.php Provides a file entity repository. 3 2
FileRepositoryInterface interface Drupal\file core/modules/file/src/FileRepositoryInterface.php Performs file system operations and updates database records accordingly. 1 1
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
FileResourceTestBase abstract class Drupal\Tests\file\Functional\Rest core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php 7 1

Other projects


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