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