Classes, traits, and interfaces - 8.9.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 1511

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
ExtractTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/ExtractTest.php @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\Extract @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
ExtraFieldBlockDeriver class Drupal\layout_builder\Plugin\Derivative core/modules/layout_builder/src/Plugin/Derivative/ExtraFieldBlockDeriver.php Provides entity field block definitions for every field.
ExtraFieldUpdatePathTest class Drupal\Tests\layout_builder\Functional\Update core/modules/layout_builder/tests/src/Functional/Update/ExtraFieldUpdatePathTest.php Tests the upgrade path for Layout Builder extra fields.
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.
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
FakePhpassHashedPassword class Drupal\Tests\Core\Password core/tests/Drupal/Tests/Core/Password/PasswordHashingTest.php A fake class for tests.
FakeRecord

in drupal:8.4.0 and is removed from drupal:9.0.0. Instead use \Drupal\Tests\system\Functional\Database\FakeRecord.

class Drupal\system\Tests\Database core/modules/system/src/Tests/Database/FakeRecord.php Fetches into a class.
FakeRecord class Drupal\Tests\system\Functional\Database core/modules/system/tests/src/Functional/Database/FakeRecord.php Fetches into a class. 1
FakeTemplateWrapper class Drupal\Tests\help_topics\Unit core/modules/help_topics/tests/src/Unit/HelpTopicTwigTest.php Defines a fake template class to mock \Twig_TemplateWrapper.
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
FallbackPluginManagerInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/FallbackPluginManagerInterface.php An interface implemented by plugin managers with fallback plugin behaviors. 5 5
Fast404ExceptionHtmlSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php High-performance 404 exception subscriber. 2
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\aggregator\Entity core/modules/aggregator/src/Entity/Feed.php Defines the aggregator feed entity class. 20
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.
FeedAccessControlHandler class Drupal\aggregator core/modules/aggregator/src/FeedAccessControlHandler.php Defines an access control handler for the feed entity.
FeedAdminDisplayTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php Tests the display of a feed on the Aggregator list page.
FeedCacheTagsTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/FeedCacheTagsTest.php Tests the Feed entity's cache tags.
FeedDeleteForm class Drupal\aggregator\Form core/modules/aggregator/src/Form/FeedDeleteForm.php Provides a form for deleting a feed.
FeedFetcherPluginTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/FeedFetcherPluginTest.php Tests the fetcher plugins functionality and discoverability.
FeedForm class Drupal\aggregator core/modules/aggregator/src/FeedForm.php Form handler for the aggregator feed edit forms.
FeedHalJsonAnonTest class Drupal\Tests\aggregator\Functional\Hal core/modules/aggregator/tests/src/Functional/Hal/FeedHalJsonAnonTest.php @group hal
FeedHalJsonBasicAuthTest class Drupal\Tests\aggregator\Functional\Hal core/modules/aggregator/tests/src/Functional/Hal/FeedHalJsonBasicAuthTest.php @group hal
FeedHalJsonCookieTest class Drupal\Tests\aggregator\Functional\Hal core/modules/aggregator/tests/src/Functional/Hal/FeedHalJsonCookieTest.php @group hal
FeedHalJsonTestBase abstract class Drupal\Tests\aggregator\Functional\Hal core/modules/aggregator/tests/src/Functional/Hal/FeedHalJsonTestBase.php 4 1
FeedHalJsonTestBase

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\aggregator\Functional\Hal\FeedHalJsonTestBase instead.

abstract class Drupal\Tests\hal\Functional\EntityResource\Feed core/modules/hal/tests/src/Functional/EntityResource/Feed/FeedHalJsonTestBase.php
FeedHtmlRouteProvider class Drupal\aggregator core/modules/aggregator/src/FeedHtmlRouteProvider.php Provides HTML routes for the feed entity type.
FeedInterface interface Drupal\aggregator core/modules/aggregator/src/FeedInterface.php Provides an interface defining an aggregator feed entity. 1 14
FeedItemsDeleteForm class Drupal\aggregator\Form core/modules/aggregator/src/Form/FeedItemsDeleteForm.php Provides a deletion confirmation form for items that belong to a feed.
FeedJsonAnonTest class Drupal\Tests\aggregator\Functional\Rest core/modules/aggregator/tests/src/Functional/Rest/FeedJsonAnonTest.php @group rest
FeedJsonBasicAuthTest class Drupal\Tests\aggregator\Functional\Rest core/modules/aggregator/tests/src/Functional/Rest/FeedJsonBasicAuthTest.php @group rest
FeedJsonCookieTest class Drupal\Tests\aggregator\Functional\Rest core/modules/aggregator/tests/src/Functional/Rest/FeedJsonCookieTest.php @group rest
FeedLanguageTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php Tests aggregator feeds in multiple languages.
FeedParserTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/FeedParserTest.php Tests the built-in feed parser with valid feed samples.
FeedProcessorPluginTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/FeedProcessorPluginTest.php Tests the processor plugins functionality and discoverability.
FeedResourceTestBase abstract class Drupal\Tests\aggregator\Functional\Rest core/modules/aggregator/tests/src/Functional/Rest/FeedResourceTestBase.php 8 2
FeedResourceTestBase

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\aggregator\Functional\Rest\FeedResourceTestBase instead.

abstract class Drupal\Tests\rest\Functional\EntityResource\Feed core/modules/rest/tests/src/Functional/EntityResource/Feed/FeedResourceTestBase.php
FeedStorage class Drupal\aggregator core/modules/aggregator/src/FeedStorage.php Controller class for aggregator's feeds.
FeedStorageInterface interface Drupal\aggregator core/modules/aggregator/src/FeedStorageInterface.php Defines an interface for aggregator feed entity storage classes. 1 5
FeedStorageSchema class Drupal\aggregator core/modules/aggregator/src/FeedStorageSchema.php Defines the feed schema handler.
FeedTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/FeedTest.php JSON:API integration test for the "Feed" content entity type.
FeedTitleConstraint class Drupal\aggregator\Plugin\Validation\Constraint core/modules/aggregator/src/Plugin/Validation/Constraint/FeedTitleConstraint.php Supports validating feed titles.
FeedUrlConstraint class Drupal\aggregator\Plugin\Validation\Constraint core/modules/aggregator/src/Plugin/Validation/Constraint/FeedUrlConstraint.php Supports validating feed URLs.
FeedValidationTest class Drupal\Tests\aggregator\Kernel core/modules/aggregator/tests/src/Kernel/FeedValidationTest.php Tests feed validation constraints.
FeedViewBuilder class Drupal\aggregator core/modules/aggregator/src/FeedViewBuilder.php View builder handler for aggregator feeds.

Other projects


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