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
ToolbarIntegrationTest class Drupal\Tests\toolbar\FunctionalJavascript core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php Tests the JavaScript functionality of the toolbar.
ToolbarItem class Drupal\toolbar\Element core/modules/toolbar/src/Element/ToolbarItem.php Provides a toolbar item that is wrapped in markup for common styling.
ToolbarLinkBuilder class Drupal\user core/modules/user/src/ToolbarLinkBuilder.php ToolbarLinkBuilder fills out the placeholders generated in user_toolbar(). 2
ToolbarMenuLinkTree class Drupal\toolbar\Menu core/modules/toolbar/src/Menu/ToolbarMenuLinkTree.php Extends MenuLinkTree to add specific theme suggestions for the toolbar. 2
ToolbarMenuTranslationTest class Drupal\Tests\toolbar\Functional core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php Tests that the toolbar icon class remains for translated menu items.
ToolkitGdTest class Drupal\KernelTests\Core\Image core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php Tests that core image manipulations work properly: scale, resize, rotate, crop, scale and crop, and desaturate.
ToolkitSetupFormTest class Drupal\FunctionalTests\Image core/tests/Drupal/FunctionalTests/Image/ToolkitSetupFormTest.php Tests image toolkit setup form.
ToolkitTest class Drupal\KernelTests\Core\Image core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php Tests the image toolkit.
ToolkitTestBase Deprecated abstract class Drupal\FunctionalTests\Image core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php Base class for image manipulation testing.
ToolkitTestTrait trait Drupal\Tests\Traits\Core\Image core/tests/Drupal/Tests/Traits/Core/Image/ToolkitTestTrait.php Provides common methods for image toolkit kernel tests. 2
TopLevelBook class Drupal\book\Plugin\views\argument_default core/modules/book/src/Plugin/views/argument_default/TopLevelBook.php Default argument plugin to get the current node's top level book.
TopLevelDataInterface interface Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/TopLevelDataInterface.php Interface for objects that can appear as top-level object data. 2 1
ToStringTrait trait Drupal\Component\Utility core/lib/Drupal/Component/Utility/ToStringTrait.php Wraps __toString in a trait to avoid some fatals. 2
Tour class Drupal\tour\Entity core/modules/tour/src/Entity/Tour.php Defines the configured tour entity. 8
TourAccessControlHandler class Drupal\tour core/modules/tour/src/TourAccessControlHandler.php Defines the access control handler for the tour entity type.
TourCacheTagsTest class Drupal\Tests\tour\Functional core/modules/tour/tests/src/Functional/TourCacheTagsTest.php Tests the Tour entity's cache tags.
TourHalJsonAnonTest class Drupal\Tests\tour\Functional\Hal core/modules/tour/tests/src/Functional/Hal/TourHalJsonAnonTest.php @group hal
TourHalJsonBasicAuthTest class Drupal\Tests\tour\Functional\Hal core/modules/tour/tests/src/Functional/Hal/TourHalJsonBasicAuthTest.php @group hal
TourHalJsonCookieTest class Drupal\Tests\tour\Functional\Hal core/modules/tour/tests/src/Functional/Hal/TourHalJsonCookieTest.php @group hal
TourHelpPageTest class Drupal\Tests\tour\Functional core/modules/tour/tests/src/Functional/TourHelpPageTest.php Verifies help page display of tours.
TourHelpSection class Drupal\tour\Plugin\HelpSection core/modules/tour/src/Plugin/HelpSection/TourHelpSection.php Provides the tours list section for the help page.
TourInterface interface Drupal\tour core/modules/tour/src/TourInterface.php Provides an interface defining a tour entity. 1 1
TourJavascriptTest class Drupal\Tests\tour\FunctionalJavascript core/modules/tour/tests/src/FunctionalJavascript/TourJavascriptTest.php General Tour tests that require JavaScript.
TourJsonAnonTest class Drupal\Tests\tour\Functional\Rest core/modules/tour/tests/src/Functional/Rest/TourJsonAnonTest.php @group rest
TourJsonBasicAuthTest class Drupal\Tests\tour\Functional\Rest core/modules/tour/tests/src/Functional/Rest/TourJsonBasicAuthTest.php @group rest
TourJsonCookieTest class Drupal\Tests\tour\Functional\Rest core/modules/tour/tests/src/Functional/Rest/TourJsonCookieTest.php @group rest
TourLegacyTest class Drupal\Tests\tour\FunctionalJavascript core/modules/tour/tests/src/FunctionalJavascript/TourLegacyTest.php Tests Tour's backwards compatible markup and legacy config.
TourPluginTest class Drupal\Tests\tour\Kernel core/modules/tour/tests/src/Kernel/TourPluginTest.php Tests the functionality of tour plugins.
TourResourceTestBase abstract class Drupal\Tests\tour\Functional\Rest core/modules/tour/tests/src/Functional/Rest/TourResourceTestBase.php 9 3
TourTest class Drupal\Tests\tour\Functional core/modules/tour/tests/src/Functional/TourTest.php Tests the functionality of tour tips.
TourTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/TourTest.php JSON:API integration test for the "Tour" config entity type.
TourTest class Drupal\Tests\tour\Unit\Entity core/modules/tour/tests/src/Unit/Entity/TourTest.php @coversDefaultClass \Drupal\tour\Entity\Tour @group tour
TourTestBase abstract class Drupal\Tests\tour\Functional core/modules/tour/tests/src/Functional/TourTestBase.php Base class for testing Tour functionality. 5 4
TourTestBasic abstract class Drupal\Tests\tour\Functional core/modules/tour/tests/src/Functional/TourTestBasic.php Simple tour tips test base. 1
TourTestController class Drupal\tour_test\Controller core/modules/tour/tests/tour_test/src/Controller/TourTestController.php Controller routines for tour_test routes.
TourTipDeprecatedConfigModuleInstallTest class Drupal\Tests\tour\Functional\Update core/modules/tour/tests/src/Functional/Update/TourTipDeprecatedConfigModuleInstallTest.php Confirms that legacy tour tips are updated when module config is imported.
TourTipDeprecatedConfigUpdateTest class Drupal\Tests\tour\Functional\Update core/modules/tour/tests/src/Functional/Update/TourTipDeprecatedConfigUpdateTest.php Confirms tour tip deprecated config is updated properly.
TourTipPluginInterface interface Drupal\tour core/modules/tour/src/TourTipPluginInterface.php Defines an interface for tour items. 2 2
TourViewBuilder class Drupal\tour core/modules/tour/src/TourViewBuilder.php Provides a Tour view builder.
TourXmlAnonTest class Drupal\Tests\tour\Functional\Rest core/modules/tour/tests/src/Functional/Rest/TourXmlAnonTest.php @group rest
TourXmlBasicAuthTest class Drupal\Tests\tour\Functional\Rest core/modules/tour/tests/src/Functional/Rest/TourXmlBasicAuthTest.php @group rest
TourXmlCookieTest class Drupal\Tests\tour\Functional\Rest core/modules/tour/tests/src/Functional/Rest/TourXmlCookieTest.php @group rest
TrackChangesTest class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/TrackChangesTest.php Tests migration track changes property.
TrackChangesTest class Drupal\migrate_track_changes_test\Plugin\migrate\source core/modules/migrate/tests/modules/migrate_track_changes_test/src/Plugin/migrate/source/TrackChangesTest.php Source plugin for migration track changes tests.
TrackerController class Drupal\tracker\Controller core/modules/tracker/src/Controller/TrackerController.php Controller for tracker pages.
TrackerNode class Drupal\tracker\Plugin\migrate\source\d7 core/modules/tracker/src/Plugin/migrate/source/d7/TrackerNode.php Drupal 7 tracker node source from database.
TrackerNodeAccessTest class Drupal\Tests\tracker\Functional core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php Tests for private node access on /tracker.
TrackerNodeTest class Drupal\Tests\tracker\Kernel\Plugin\migrate\source\d7 core/modules/tracker/tests/src/Kernel/Plugin/migrate/source/d7/TrackerNodeTest.php Tests D7 tracker node source plugin.
TrackerRecentContentLinkTest class Drupal\Tests\tracker\Functional core/modules/tracker/tests/src/Functional/TrackerRecentContentLinkTest.php Tests recent content link.
TrackerTest class Drupal\Tests\tracker\Functional core/modules/tracker/tests/src/Functional/TrackerTest.php Create and delete nodes and check for their display in the tracker listings.

Pages

Other projects