Classes, traits, and interfaces - 10.3.x - 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 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
AccountInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/AccountInterface.php Defines an account interface which represents the current user. 3 390
AccountPermissionsCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php Defines the AccountPermissionsCacheContext service, for "per permission" caching. 2
AccountProxy class Drupal\Core\Session core/lib/Drupal/Core/Session/AccountProxy.php A proxied implementation of AccountInterface. 2 2
AccountProxyInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/AccountProxyInterface.php Defines an interface for a service which has the current account stored. 1 15
AccountProxyTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php @coversDefaultClass \Drupal\Core\Session\AccountProxy @group Session
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. 3 1
AccountSwitcher class Drupal\Core\Session core/lib/Drupal/Core/Session/AccountSwitcher.php An implementation of AccountSwitcherInterface. 2
AccountSwitcherInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/AccountSwitcherInterface.php Defines an interface for a service for safe account switching. 2 12
AccountSwitcherTest class Drupal\KernelTests\Core\Session core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php Test case for account switching.
Action class Drupal\Core\Action\Attribute core/lib/Drupal/Core/Action/Attribute/Action.php Defines an Action attribute object. 25
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. 23
Action class Drupal\system\Plugin\migrate\source core/modules/system/src/Plugin/migrate/source/Action.php Drupal action source from database. 1
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. 1
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. 10 9
ActionConfigEntityInterface interface Drupal\system core/modules/system/src/ActionConfigEntityInterface.php Provides an interface defining an action entity. 1 2
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
ActionInterface interface Drupal\Core\Action core/lib/Drupal/Core/Action/ActionInterface.php Provides an interface for an Action plugin. 1 2 1
ActionJsonAnonTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionJsonAnonTest.php @group Action
ActionJsonAnonTest class Drupal\Tests\action\Functional\Rest core/modules/action/tests/src/Functional/Rest/ActionJsonAnonTest.php @group action
ActionJsonBasicAuthTest class Drupal\Tests\action\Functional\Rest core/modules/action/tests/src/Functional/Rest/ActionJsonBasicAuthTest.php @group action
ActionJsonBasicAuthTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionJsonBasicAuthTest.php @group Action
ActionJsonCookieTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionJsonCookieTest.php @group Action
ActionJsonCookieTest class Drupal\Tests\action\Functional\Rest core/modules/action/tests/src/Functional/Rest/ActionJsonCookieTest.php @group action
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
ActionMethod final class Drupal\Core\Config\Action\Attribute core/lib/Drupal/Core/Config/Action/Attribute/ActionMethod.php @internal This API is experimental. 10
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\action\Functional\Rest core/modules/action/tests/src/Functional/Rest/ActionResourceTestBase.php 6
ActionResourceTestBase abstract class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionResourceTestBase.php 6
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\action\Functional\Jsonapi core/modules/action/tests/src/Functional/Jsonapi/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\system\Kernel\Plugin\migrate\source core/modules/system/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 UI does not remove other modules' actions.
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\action\Functional\Rest core/modules/action/tests/src/Functional/Rest/ActionXmlAnonTest.php @group action
ActionXmlAnonTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionXmlAnonTest.php @group Action
ActionXmlBasicAuthTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/ActionXmlBasicAuthTest.php @group Action
ActionXmlBasicAuthTest class Drupal\Tests\action\Functional\Rest core/modules/action/tests/src/Functional/Rest/ActionXmlBasicAuthTest.php @group action

Other projects


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