You are here

Classes, traits, and interfaces in Drupal 9

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

Namesort descending Type Namespace Location Description Direct uses Use statements Strings
AddRoleUser class Drupal\user\Plugin\Action core/modules/user/src/Plugin/Action/AddRoleUser.php Adds a role to a user. 1
AddRoleUserTest class Drupal\Tests\user\Unit\Plugin\Action core/modules/user/tests/src/Unit/Plugin/Action/AddRoleUserTest.php @coversDefaultClass \Drupal\user\Plugin\Action\AddRoleUser @group user
AddSectionController class Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/AddSectionController.php Defines a controller to add a new section.
AddStyleSheetCommand class Drupal\ckeditor\Ajax core/modules/ckeditor/src/Ajax/AddStyleSheetCommand.php AJAX command to add style sheets to a CKEditor instance. 1
AdminContext class Drupal\Core\Routing core/lib/Drupal/Core/Routing/AdminContext.php Provides a helper class to determine whether the route is an admin one. 5 2
AdminController class Drupal\system\Controller core/modules/system/src/Controller/AdminController.php Controller for admin section.
AdminDemoNegotiator class Drupal\block\Theme core/modules/block/src/Theme/AdminDemoNegotiator.php Negotiates the theme for the block admin demo page via the URL. 2
AdminHtmlRouteProvider class Drupal\Core\Entity\Routing core/lib/Drupal/Core/Entity/Routing/AdminHtmlRouteProvider.php Provides HTML routes for entities with administrative add/edit/delete pages. 3 4
AdminMetaTagTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php Confirm that the fingerprinting meta tag appears as expected.
AdminNegotiator class Drupal\user\Theme core/modules/user/src/Theme/AdminNegotiator.php Sets the active theme on admin pages. 1 2
AdminNegotiatorTest class Drupal\Tests\user\Unit\Theme core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php Tests AdminNegotiator class.
AdminPathConfigEntityConverter class Drupal\Core\ParamConverter core/lib/Drupal/Core/ParamConverter/AdminPathConfigEntityConverter.php Makes sure the unmodified ConfigEntity is loaded on admin pages. 1 1 2
AdminPathConfigEntityConverter class Drupal\Core\ProxyClass\ParamConverter core/lib/Drupal/Core/ProxyClass/ParamConverter/AdminPathConfigEntityConverter.php Provides a proxy class for \Drupal\Core\ParamConverter\AdminPathConfigEntityConverter.
AdminPathEntityConverterLanguageTest class Drupal\Tests\language\Functional core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php Test administration path based conversion of entities. 1 1
AdminRouteSubscriber class Drupal\system\EventSubscriber core/modules/system/src/EventSubscriber/AdminRouteSubscriber.php Adds the _admin_route option to each admin HTML route. 1 2
AdminRouteSubscriberTest class Drupal\Tests\system\Unit\Routing core/modules/system/tests/src/Unit/Routing/AdminRouteSubscriberTest.php @coversDefaultClass \Drupal\system\EventSubscriber\AdminRouteSubscriber @group system
AdminTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/AdminTest.php Tests output on administrative pages and compact mode functionality.
AdvancedSettingsForm class Drupal\views_ui\Form core/modules/views_ui/src/Form/AdvancedSettingsForm.php Form builder for the advanced admin settings page. 1
AdvisoriesConfigSubscriber class Drupal\system\EventSubscriber core/modules/system/src/EventSubscriber/AdvisoriesConfigSubscriber.php Defines a config subscriber for changes to 'system.advisories'. 2
AdvisoriesTestHttpClient class Drupal\advisory_feed_test core/modules/system/tests/modules/advisory_feed_test/src/AdvisoriesTestHttpClient.php Provides a decorator service for the 'http_client' service for testing. 1 2
AdvisoriesUpdatePathTest class Drupal\Tests\system\Functional\SecurityAdvisories core/modules/system/tests/src/Functional/SecurityAdvisories/AdvisoriesUpdatePathTest.php Tests advisories settings update path.
AdvisoryTestController class Drupal\advisory_feed_test\Controller core/modules/system/tests/modules/advisory_feed_test/src/Controller/AdvisoryTestController.php Defines a controller to return JSON for security advisory tests.
AfterCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/AfterCommand.php An AJAX command for calling the jQuery after() method. 2
AggregatorAdminTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/AggregatorAdminTest.php Tests aggregator admin pages.
AggregatorController class Drupal\aggregator\Controller core/modules/aggregator/src/Controller/AggregatorController.php Returns responses for aggregator module routes.
AggregatorCronTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/AggregatorCronTest.php Update feeds on cron.
AggregatorDisplayConfigurableTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/AggregatorDisplayConfigurableTest.php Tests making aggregator_feed and aggregator_item base fields' displays configurable.
AggregatorFeed class Drupal\aggregator\Plugin\migrate\source core/modules/aggregator/src/Plugin/migrate/source/AggregatorFeed.php Drupal 6/7 feed source from database.
AggregatorFeedBlock class Drupal\aggregator\Plugin\Block core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php Provides an 'Aggregator feed' block with the latest items from the feed.
AggregatorFeedTest class Drupal\Tests\aggregator\Kernel\Plugin\migrate\source core/modules/aggregator/tests/src/Kernel/Plugin/migrate/source/AggregatorFeedTest.php Tests D6 aggregator feed source plugin.
AggregatorFeedViewsData class Drupal\aggregator core/modules/aggregator/src/AggregatorFeedViewsData.php Provides the views data for the aggregator feed entity type.
AggregatorFeedViewsFieldAccessTest class Drupal\Tests\aggregator\Kernel\Views core/modules/aggregator/tests/src/Kernel/Views/AggregatorFeedViewsFieldAccessTest.php Tests base field access in Views for the aggregator_feed entity.
AggregatorFetcher class Drupal\aggregator\Annotation core/modules/aggregator/src/Annotation/AggregatorFetcher.php Defines a Plugin annotation object for aggregator fetcher plugins.
AggregatorItem class Drupal\aggregator\Plugin\migrate\source core/modules/aggregator/src/Plugin/migrate/source/AggregatorItem.php Drupal 6/7 aggregator item source from database.
AggregatorItemTest class Drupal\Tests\aggregator\Kernel\Plugin\migrate\source core/modules/aggregator/tests/src/Kernel/Plugin/migrate/source/AggregatorItemTest.php Tests aggregator item source plugin.
AggregatorItemViewsData class Drupal\aggregator core/modules/aggregator/src/AggregatorItemViewsData.php Provides the views data for the aggregator item entity type.
AggregatorItemViewsFieldAccessTest class Drupal\Tests\aggregator\Kernel\Views core/modules/aggregator/tests/src/Kernel/Views/AggregatorItemViewsFieldAccessTest.php Tests base field access in Views for the aggregator_item entity.
AggregatorLocalTasksTest class Drupal\Tests\aggregator\Unit\Menu core/modules/aggregator/tests/src/Unit/Menu/AggregatorLocalTasksTest.php Tests existence of aggregator local tasks.
AggregatorParser class Drupal\aggregator\Annotation core/modules/aggregator/src/Annotation/AggregatorParser.php Defines a Plugin annotation object for aggregator parser plugins.
AggregatorPluginManager class Drupal\aggregator\Plugin core/modules/aggregator/src/Plugin/AggregatorPluginManager.php Manages aggregator plugins. 2 4
AggregatorPluginManagerTest class Drupal\Tests\aggregator\Kernel core/modules/aggregator/tests/src/Kernel/AggregatorPluginManagerTest.php Tests the aggregator plugin manager.
AggregatorPluginSettingsBase abstract class Drupal\aggregator\Plugin core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php Base class for aggregator plugins that implement settings forms. 2 2
AggregatorPluginSettingsBaseTest class Drupal\Tests\aggregator\Unit\Plugin core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php Tests settings configuration of individual aggregator plugins.
AggregatorProcessor class Drupal\aggregator\Annotation core/modules/aggregator/src/Annotation/AggregatorProcessor.php Defines a Plugin annotation object for aggregator processor plugins.
AggregatorRefresh class Drupal\aggregator\Plugin\QueueWorker core/modules/aggregator/src/Plugin/QueueWorker/AggregatorRefresh.php Updates a feed's items.
AggregatorRenderingTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php Tests display of aggregator items on the page.
AggregatorTestBase abstract class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php Defines a base class for testing the Aggregator module. 15
AggregatorTestRssController class Drupal\aggregator_test\Controller core/modules/aggregator/tests/modules/aggregator_test/src/Controller/AggregatorTestRssController.php Controller for the aggregator_test module.
AggregatorTitleFormatter class Drupal\aggregator\Plugin\Field\FieldFormatter core/modules/aggregator/src/Plugin/Field/FieldFormatter/AggregatorTitleFormatter.php Plugin implementation of the 'aggregator_title' formatter.
AggregatorTitleTest class Drupal\Tests\aggregator\Kernel core/modules/aggregator/tests/src/Kernel/AggregatorTitleTest.php Tests the aggregator_title formatter.

Pages

Other projects