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
AccountSwitcherInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/AccountSwitcherInterface.php Defines an interface for a service for safe account switching. 1 1
AccountSwitcherTest class Drupal\KernelTests\Core\Session core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php Test case for account switching.
Action class Drupal\Core\Annotation core/lib/Drupal/Core/Annotation/Action.php Defines an Action annotation object.
Action class Drupal\system\Entity core/modules/system/src/Entity/Action.php Defines the configured action entity. 16
Action class Drupal\action\Plugin\migrate\source core/modules/action/src/Plugin/migrate/source/Action.php Drupal 6/7 action source from database.
ActionAddForm class Drupal\action\Form core/modules/action/src/Form/ActionAddForm.php Provides a form for action add forms. 1
ActionAdminManageForm class Drupal\action\Form core/modules/action/src/Form/ActionAdminManageForm.php Provides a configuration form for configurable actions.
ActionAjaxTest class Drupal\action_form_ajax_test\Plugin\Action core/modules/action/tests/action_form_ajax_test/src/Plugin/Action/ActionAjaxTest.php Plugin used for testing AJAX in action config entity forms.
ActionBase abstract class Drupal\Core\Action core/lib/Drupal/Core/Action/ActionBase.php Provides a base implementation for an Action plugin. 9 8
ActionConfigEntityInterface interface Drupal\system core/modules/system/src/ActionConfigEntityInterface.php Provides an interface defining an action entity. 1 3
ActionConfigTest class Drupal\Tests\action\Functional\Update core/modules/action/tests/src/Functional/Update/ActionConfigTest.php Tests removing action module's configuration.
ActionDeleteForm class Drupal\action\Form core/modules/action/src/Form/ActionDeleteForm.php Builds a form to delete an action.
ActionEditForm class Drupal\action\Form core/modules/action/src/Form/ActionEditForm.php Provides a form for action edit forms. 1
ActionFormAjaxTest class Drupal\Tests\action\FunctionalJavascript core/modules/action/tests/src/FunctionalJavascript/ActionFormAjaxTest.php Tests action plugins using JavaScript.
ActionFormBase abstract class Drupal\action\Form core/modules/action/src/Form/ActionFormBase.php Provides a base form for action forms. 2
ActionHalJsonAnonTest class Drupal\Tests\system\Functional\Hal core/modules/system/tests/src/Functional/Hal/ActionHalJsonAnonTest.php @group hal
ActionHalJsonBasicAuthTest class Drupal\Tests\system\Functional\Hal core/modules/system/tests/src/Functional/Hal/ActionHalJsonBasicAuthTest.php @group hal
ActionHalJsonCookieTest class Drupal\Tests\system\Functional\Hal core/modules/system/tests/src/Functional/Hal/ActionHalJsonCookieTest.php @group hal
ActionInterface interface Drupal\Core\Action core/lib/Drupal/Core/Action/ActionInterface.php Provides an interface for an Action plugin. 1 1
ActionJsonAnonTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionJsonAnonTest.php @group rest
ActionJsonBasicAuthTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionJsonBasicAuthTest.php @group rest
ActionJsonCookieTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionJsonCookieTest.php @group rest
ActionListBuilder class Drupal\action core/modules/action/src/ActionListBuilder.php Defines a class to build a listing of action entities.
ActionListTest class Drupal\Tests\action\Functional core/modules/action/tests/src/Functional/ActionListTest.php Test behaviors when visiting the action listing page.
ActionLocalTasksTest class Drupal\Tests\action\Unit\Menu core/modules/action/tests/src/Unit/Menu/ActionLocalTasksTest.php Tests action local tasks.
ActionManager class Drupal\Core\Action core/lib/Drupal/Core/Action/ActionManager.php Provides an Action plugin manager. 2 2
ActionPluginCollection class Drupal\Core\Action core/lib/Drupal/Core/Action/ActionPluginCollection.php Provides a container for lazily loading Action plugins. 1
ActionResourceTestBase abstract class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionResourceTestBase.php 9 3
Actions class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Actions.php Provides a wrapper element to group one or more buttons in a form.
ActionsTest class Drupal\KernelTests\Core\Render\Element core/tests/Drupal/KernelTests/Core/Render/Element/ActionsTest.php @coversDefaultClass \Drupal\Core\Render\Element\Actions @group Render
ActionTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/ActionTest.php JSON:API integration test for the "Action" config entity type.
ActionTest class Drupal\Tests\system\Kernel\Action core/modules/system/tests/src/Kernel/Action/ActionTest.php Tests action plugins.
ActionTest class Drupal\Tests\action\Kernel\Plugin\migrate\source core/modules/action/tests/src/Kernel/Plugin/migrate/source/ActionTest.php Tests actions source plugin.
ActionUninstallTest class Drupal\Tests\action\Functional core/modules/action/tests/src/Functional/ActionUninstallTest.php Tests that uninstalling Actions does not remove other modules' actions.
ActionXmlAnonTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionXmlAnonTest.php @group rest
ActionXmlBasicAuthTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionXmlBasicAuthTest.php @group rest
ActionXmlCookieTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionXmlCookieTest.php @group rest
ActiveLinkResponseFilter class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php Subscribes to filter HTML responses, to set the 'is-active' class on links. 1 2
ActiveLinkResponseFilterTest class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php @coversDefaultClass \Drupal\Core\EventSubscriber\ActiveLinkResponseFilter @group EventSubscriber
ActiveTheme class Drupal\Core\Theme core/lib/Drupal/Core/Theme/ActiveTheme.php Defines a theme and its information needed at runtime. 5
ActiveTopicsBlock class Drupal\forum\Plugin\Block core/modules/forum/src/Plugin/Block/ActiveTopicsBlock.php Provides an 'Active forum topics' block.
ActiveWorkspaceCheck class Drupal\workspaces\Access core/modules/workspaces/src/Access/ActiveWorkspaceCheck.php Determines access to routes based on the presence of an active workspace. 1 2
ActiveWorkspaceCheckTest class Drupal\Tests\workspaces\Unit core/modules/workspaces/tests/src/Unit/ActiveWorkspaceCheckTest.php @coversDefaultClass \Drupal\workspaces\Access\ActiveWorkspaceCheck
ActiveWorkspaceUpdateTest class Drupal\Tests\workspaces\Functional\UpdateSystem core/modules/workspaces/tests/src/Functional/UpdateSystem/ActiveWorkspaceUpdateTest.php Tests that there is no active workspace during database updates.
AddBlockForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/AddBlockForm.php Provides a form to add a block. 1
AddCssCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/AddCssCommand.php An AJAX command for adding css to the page via ajax. 3
AddFeedTest class Drupal\Tests\aggregator\Functional core/modules/aggregator/tests/src/Functional/AddFeedTest.php Add feed test.
AddFeedTest class Drupal\Tests\system\Kernel\Common core/modules/system/tests/src/Kernel/Common/AddFeedTest.php Make sure that attaching feeds works correctly with various constructs.
AddFormBase abstract class Drupal\media_library\Form core/modules/media_library/src/Form/AddFormBase.php Provides a base class for creating media items from within the media library. 3 1
AddHandler class Drupal\views_ui\Form\Ajax core/modules/views_ui/src/Form/Ajax/AddHandler.php Provides a form for adding an item in the Views UI.

Pages

Other projects