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
FilterTestFormatForm class Drupal\filter_test\Form core/modules/filter/tests/filter_test/src/Form/FilterTestFormatForm.php Shows a test form for testing the 'text_format' form element. 1
FilterTestHooks class Drupal\filter_test\Hook core/modules/filter/tests/filter_test/src/Hook/FilterTestHooks.php Hook implementations for filter_test.
FilterTestPlaceholders class Drupal\filter_test\Plugin\Filter core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestPlaceholders.php Provides a test filter to use placeholders.
FilterTestReplace class Drupal\filter_test\Plugin\Filter core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestReplace.php Provides a test filter to replace all content.
FilterTestRestrictTagsAndAttributes class Drupal\filter_test\Plugin\Filter core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestRestrictTagsAndAttributes.php Provides a test filter to restrict HTML tags and attributes.
FilterTestStatic class Drupal\filter_test_plugin\Plugin\Filter core/modules/filter/tests/filter_test_plugin/src/Plugin/Filter/FilterTestStatic.php Provides a filter that returns the same static text.
FilterThemeHooks class Drupal\filter\Hook core/modules/filter/src/Hook/FilterThemeHooks.php Theme hooks for filter.
FilterUidRevisionTest class Drupal\Tests\node\Kernel\Views core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php Tests the node_uid_revision handler.
FilterUITest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/FilterUITest.php Tests for the filters from the UI.
FilterUninstallValidator class Drupal\filter core/modules/filter/src/FilterUninstallValidator.php Prevents uninstallation of modules providing used filter plugins. 1 2
FilterUninstallValidatorTest class Drupal\Tests\filter\Unit core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php Tests Drupal\filter\FilterUninstallValidator.
FilterUrl class Drupal\filter\Plugin\Filter core/modules/filter/src/Plugin/Filter/FilterUrl.php Provides a filter to convert URLs into links. 2
FinalExceptionSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php Last-chance handler for exceptions: the final exception subscriber. 1 1 2
FinalExceptionSubscriberTest class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php Tests Drupal\Core\EventSubscriber\FinalExceptionSubscriber.
FinalMissingContentSubscriber class Drupal\Core\Config\Importer core/lib/Drupal/Core/Config/Importer/FinalMissingContentSubscriber.php Final event subscriber to the missing content event. 2
FinalTestHttpMiddlewareClass final class Drupal\Tests\Core\DependencyInjection\Fixture core/tests/Drupal/Tests/Core/DependencyInjection/Fixture/FinalTestHttpMiddlewareClass.php Stub of http_middleware class that is declared final. 1
FinalTestNonTerminableHttpMiddlewareClass final class Drupal\Tests\Core\DependencyInjection\Fixture core/tests/Drupal/Tests/Core/DependencyInjection/Fixture/FinalTestNonTerminableHttpMiddlewareClass.php Stub of http_middleware class that is declared final but is not terminable. 1
Finder final class Drupal\Core\DefaultContent core/lib/Drupal/Core/DefaultContent/Finder.php Finds all default content in a directory, in dependency order. 7
FinderTest class Drupal\Tests\Core\DefaultContent core/tests/Drupal/Tests/Core/DefaultContent/FinderTest.php Tests Finder.
FinishResponseSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php Response subscriber to handle finished responses. 1 2
FinishResponseSubscriberTest class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/FinishResponseSubscriberTest.php Tests Drupal\Core\EventSubscriber\FinishResponseSubscriber.
FirstOrLast class Drupal\Core\Hook\OrderOperation core/lib/Drupal/Core/Hook/OrderOperation/FirstOrLast.php Moves one listener to the start or end of the list. 2
Fixed class Drupal\views\Plugin\views\argument_default core/modules/views/src/Plugin/views/argument_default/Fixed.php The fixed argument default handler.
FixtureDeprecatedClass class Drupal\deprecation_test\Deprecation core/modules/system/tests/modules/deprecation_test/src/Deprecation/FixtureDeprecatedClass.php Fixture for Drupal\FunctionalTests\Core\Container\ServiceDeprecationTest. 3 2
FixtureManipulator class Drupal\fixture_manipulator core/modules/package_manager/tests/modules/fixture_manipulator/src/FixtureManipulator.php Manipulates a test fixture using Composer commands. 2 3
FixtureManipulatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/FixtureManipulatorTest.php Tests Drupal\fixture_manipulator\FixtureManipulator.
FixtureManipulatorTrait trait Drupal\Tests\package_manager\Traits core/modules/package_manager/tests/src/Traits/FixtureManipulatorTrait.php A trait for common fixture manipulator functions. 1
Fixtures class Drupal\Tests\Composer\Generator core/tests/Drupal/Tests/Composer/Generator/Fixtures.php Convenience class for creating fixtures.
Fixtures class Drupal\Tests\Composer\Plugin\Unpack core/tests/Drupal/Tests/Composer/Plugin/Unpack/Fixtures.php Fixture for testing the unpack composer plugin. 1
Fixtures class Drupal\Tests\Composer\Plugin\Scaffold core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Fixtures.php Convenience class for creating fixtures. 9
FixturesBase abstract class Drupal\Tests\Composer\Plugin core/tests/Drupal/Tests/Composer/Plugin/FixturesBase.php Base class for fixtures to test composer plugins. 2 2
FixtureUtilityTrait trait Drupal\Tests\package_manager\Traits core/modules/package_manager/tests/src/Traits/FixtureUtilityTrait.php A utility for all things fixtures. 3
Flatten class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/Flatten.php Flattens the source value. 1
FlattenTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/FlattenTest.php Tests the flatten plugin.
FloatData class Drupal\Core\TypedData\Plugin\DataType core/lib/Drupal/Core/TypedData/Plugin/DataType/FloatData.php The float data type. 2 1
FloatInterface interface Drupal\Core\TypedData\Type core/lib/Drupal/Core/TypedData/Type/FloatInterface.php Interface for floating-point numbers. 1 5
FloatItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php Defines the 'float' field type.
FloodInterface interface Drupal\Core\Flood core/lib/Drupal/Core/Flood/FloodInterface.php Defines an interface for flood controllers. 3 6
FloodTest class Drupal\Tests\system\Kernel\System core/modules/system/tests/src/Kernel/System/FloodTest.php Functional tests for the flood control mechanism.
FocusFirstCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/FocusFirstCommand.php AJAX command for focusing an element. 4
FocusFirstCommandTest class Drupal\FunctionalJavascriptTests\Ajax core/tests/Drupal/FunctionalJavascriptTests/Ajax/FocusFirstCommandTest.php Tests setting focus via AJAX command.
FolderTest class Drupal\FunctionalTests core/tests/Drupal/FunctionalTests/FolderTest.php Tests BrowserTestBase's treatment of hook_install() during setup.
FollowUpMigrationsTest class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/FollowUpMigrationsTest.php Tests follow-up migrations.
FollowUpMigrationsTest class Drupal\Tests\migrate_drupal\Kernel\d7 core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php Tests follow-up migrations.
Foo class Drupal\image_test\Plugin\ImageToolkit\Operation\test core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/Foo.php Builds an image toolkit operation.
FooAccessPolicy class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php A test access policy for admin and for 'foo' and 'bar' permissions.
FooCacheContext class Drupal\Tests\Core\Cache\Context core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php Fake cache context class.
FooDerived class Drupal\image_test\Plugin\ImageToolkit\Operation\test core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/FooDerived.php Builds an image toolkit operation.
FooTest final class Drupal\Tests\Component\Foo core/tests/PHPStan/fixtures/component-tests.php
Form class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Form.php Provides a render element for a form.

Other projects


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