Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
AccountEvents final class Drupal\Core\Session core/lib/Drupal/Core/Session/AccountEvents.php Defines events for the account system.
AccountForm abstract class Drupal\user core/modules/user/src/AccountForm.php Form controller for the user account forms.
AccountInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/AccountInterface.php Defines an account interface which represents the current user.
AccountPermissionsCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php The account permission cache context for "per permission" caching.
AccountProxy class Drupal\Core\Session core/lib/Drupal/Core/Session/AccountProxy.php A proxied implementation of AccountInterface.
AccountProxyInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/AccountProxyInterface.php Defines an interface for a service which has the current account stored.
AccountProxyTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php Tests Drupal\Core\Session\AccountProxy.
AccountSetEvent final class Drupal\Core\Session core/lib/Drupal/Core/Session/AccountSetEvent.php Event fired when an account is set for the current session.
AccountSettingsForm class Drupal\user core/modules/user/src/AccountSettingsForm.php Configure user settings for this site.
AccountSwitcher class Drupal\Core\Session core/lib/Drupal/Core/Session/AccountSwitcher.php An implementation of AccountSwitcherInterface.
AccountSwitcherInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/AccountSwitcherInterface.php Defines an interface for a service for safe account switching.
AccountSwitcherTest class Drupal\KernelTests\Core\Session core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php Test case for account switching.
AccountTakeoverGadgetChainTest class Drupal\KernelTests\Core\User core/tests/Drupal/KernelTests/Core/User/AccountTakeoverGadgetChainTest.php Tests protection against SA-CORE-2024-007 Gadget Chain.
ACrossHookReorderAlter class Drupal\aaa_hook_order_test\Hook core/modules/system/tests/modules/HookOrder/aaa_hook_order_test/src/Hook/ACrossHookReorderAlter.php Contains alter hook implementations.
Action class Drupal\system\Entity core/modules/system/src/Entity/Action.php Defines the configured action entity.
Action class Drupal\system\Plugin\migrate\source core/modules/system/src/Plugin/migrate/source/Action.php Drupal action source from database.
Action class Drupal\Core\Action\Attribute core/lib/Drupal/Core/Action/Attribute/Action.php Defines an Action attribute object.
Action class Drupal\Core\Annotation core/lib/Drupal/Core/Annotation/Action.php Defines an Action annotation object.
ActionBase abstract class Drupal\Core\Action core/lib/Drupal/Core/Action/ActionBase.php Provides a base implementation for an Action plugin.
ActionConfigEntityInterface interface Drupal\system core/modules/system/src/ActionConfigEntityInterface.php Provides an interface defining an action entity.
ActionInterface interface Drupal\Core\Action core/lib/Drupal/Core/Action/ActionInterface.php Provides an interface for an Action plugin.
ActionJsonAnonTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionJsonAnonTest.php Tests Action Json Anon.
ActionJsonBasicAuthTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionJsonBasicAuthTest.php Tests Action Json Basic Auth.
ActionJsonCookieTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionJsonCookieTest.php Tests Action Json Cookie.
ActionManager class Drupal\Core\Action core/lib/Drupal/Core/Action/ActionManager.php Provides an Action plugin manager.
ActionMethod final class Drupal\Core\Config\Action\Attribute core/lib/Drupal/Core/Config/Action/Attribute/ActionMethod.php @internal This API is experimental.
ActionMethodAttributeTest class Drupal\Tests\Core\Config\Action core/tests/Drupal/Tests/Core/Config/Action/ActionMethodAttributeTest.php Tests Drupal\Core\Config\Action\Attribute\ActionMethod.
ActionPluginCollection class Drupal\Core\Action core/lib/Drupal/Core/Action/ActionPluginCollection.php Provides a container for lazily loading Action plugins.
ActionResourceTestBase abstract class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionResourceTestBase.php Resource test base for the action entity.
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 Tests Drupal\Core\Render\Element\Actions.
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\Plugin\migrate\source core/modules/system/tests/src/Kernel/Plugin/migrate/source/ActionTest.php Tests actions source plugin.
ActionTest class Drupal\Tests\system\Kernel\Action core/modules/system/tests/src/Kernel/Action/ActionTest.php Tests action plugins.
ActionValidationTest class Drupal\Tests\system\Kernel\Entity core/modules/system/tests/src/Kernel/Entity/ActionValidationTest.php Tests validation of action entities.
ActionXmlAnonTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionXmlAnonTest.php Tests Action Xml Anon.
ActionXmlBasicAuthTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionXmlBasicAuthTest.php Tests Action Xml Basic Auth.
ActionXmlCookieTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionXmlCookieTest.php Tests Action Xml Cookie.
ActiveFixtureManipulator final class Drupal\fixture_manipulator core/modules/package_manager/tests/modules/fixture_manipulator/src/ActiveFixtureManipulator.php A fixture manipulator for the active directory.
ActiveLinkResponseFilter class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php Subscribes to filter HTML responses, to set attributes on active links.
ActiveLinkResponseFilterTest class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php Tests Drupal\Core\EventSubscriber\ActiveLinkResponseFilter.
ActiveLinkTest class Drupal\Tests\system\FunctionalJavascript core/modules/system/tests/src/FunctionalJavascript/ActiveLinkTest.php Tests active link JS behavior.
ActiveTheme class Drupal\Core\Theme core/lib/Drupal/Core/Theme/ActiveTheme.php Defines a theme and its information needed at runtime.
ActiveWorkspaceCheck class Drupal\workspaces\Access core/modules/workspaces/src/Access/ActiveWorkspaceCheck.php Determines access to routes based on the presence of an active workspace.
ActiveWorkspaceCheckTest class Drupal\Tests\workspaces\Unit core/modules/workspaces/tests/src/Unit/ActiveWorkspaceCheckTest.php Tests Drupal\workspaces\Access\ActiveWorkspaceCheck.
ActiveWorkspaceTestForm class Drupal\workspaces_test\Form core/modules/workspaces/tests/modules/workspaces_test/src/Form/ActiveWorkspaceTestForm.php Form for testing the active workspace.
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.
AddComponent final class Drupal\layout_builder\Plugin\ConfigAction core/modules/layout_builder/src/Plugin/ConfigAction/AddComponent.php Adds a component to a layout builder section.
AddComponentDeriver final class Drupal\layout_builder\Plugin\ConfigAction\Deriver core/modules/layout_builder/src/Plugin/ConfigAction/Deriver/AddComponentDeriver.php @internal This API is experimental.

Other projects


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