Classes, traits, and interfaces in Drupal 8
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 |
---|---|---|---|---|---|---|---|
AbstractOperation | abstract class |
Drupal\ |
composer/ |
Provides default behaviors for operations. | 3 | ||
AcceptHeaderMatcher | class |
Drupal\ |
core/ |
Filters routes based on the media type specified in the HTTP Accept headers. | 1 | 2 | |
AcceptHeaderMatcherTest | class |
Drupal\ |
core/ |
Confirm that the mime types partial matcher is functioning properly. | |||
AcceptHeaderMiddleware | class |
Drupal\ |
core/ |
Example implementation of "accept header"-based content negotiation. | |||
AcceptHeaderRoutingTestServiceProvider | class |
Drupal\ |
core/ |
Service provider for the accept_header_routing_test module. | |||
Access | class |
Drupal\ |
core/ |
Filter by node_access records. | |||
AccessArgumentsResolverFactory | class |
Drupal\ |
core/ |
Resolves the arguments to pass to an access check callable. | 2 | ||
AccessArgumentsResolverFactoryInterface | interface |
Drupal\ |
core/ |
Constructs the arguments resolver instance to use when running access checks. | 1 | ||
AccessAwareRouter | class |
Drupal\ |
core/ |
A router class for Drupal with access check and upcasting. | 1 | 2 | |
AccessAwareRouterInterface | interface |
Drupal\ |
core/ |
Interface for a router class for Drupal with access check and upcasting. | 1 | 6 | |
AccessAwareRouterTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Routing\AccessAwareRouter @group Routing | |||
AccessCheck | class |
Drupal\ |
core/ |
Checks access based on the 'menu_test' key in session. | 2 | ||
AccessCheckInterface | interface |
Drupal\ |
core/ |
An access check service determines access rules for particular routes. | 2 | 1 | |
AccessDeniedSubscriber | class |
Drupal\ |
core/ |
Redirects users when access is denied. | 2 | ||
AccessDeniedTest | class |
Drupal\ |
core/ |
Tests page access denied functionality, including custom 403 pages. | |||
AccessException | class |
Drupal\ |
core/ |
An exception thrown for access errors. | 1 | 3 | |
AccessGroupAnd | class |
Drupal\ |
core/ |
An access group where all the dependencies must be allowed. | 2 | ||
AccessGroupAndTest | class |
Drupal\ |
core/ |
Tests accessible groups. | |||
AccessibleInterface | interface |
Drupal\ |
core/ |
Interface for checking access. | 8 | 17 | |
AccessibleTestingTrait | trait |
Drupal\ |
core/ |
Helper methods testing accessible interfaces. | |||
AccessInterface | interface |
Drupal\ |
core/ |
An access check service determines access rules for particular routes. | 41 | 42 | |
AccessManager | class |
Drupal\ |
core/ |
Attaches access check services to routes and runs them on request. | 1 | 2 | |
AccessManagerInterface | interface |
Drupal\ |
core/ |
Provides an interface for attaching and running access check services. | 1 | 16 | |
AccessManagerTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Access\AccessManager @group Access | |||
AccessPermissionTest | class |
Drupal\ |
core/ |
Tests views perm access plugin. | |||
AccessPluginBase | abstract class |
Drupal\ |
core/ |
The base plugin to handle access control. | 5 | 5 | |
AccessResult | abstract class |
Drupal\ |
core/ |
Value object for passing an access result with cacheability metadata. | 3 | 204 | |
AccessResultAllowed | class |
Drupal\ |
core/ |
Value object indicating an allowed access result, with cacheability metadata. | 4 | ||
AccessResultForbidden | class |
Drupal\ |
core/ |
Value object indicating a forbidden access result, with cacheability metadata. | 4 | ||
AccessResultForbiddenTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Access\AccessResultForbidden @group Access | |||
AccessResultInterface | interface |
Drupal\ |
core/ |
Interface for access result value objects. | 3 | 13 | |
AccessResultNeutral | class |
Drupal\ |
core/ |
Value object indicating a neutral access result, with cacheability metadata. | 6 | ||
AccessResultNeutralTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Access\AccessResultNeutral @group Access | |||
AccessResultReasonInterface | interface |
Drupal\ |
core/ |
Interface for access result value objects with stored reason for developers. | 2 | 14 | |
AccessResultTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Access\AccessResult @group Access | |||
AccessRoleTest | class |
Drupal\ |
core/ |
Tests views role access plugin. | |||
AccessRoleUITest | class |
Drupal\ |
core/ |
Tests views role access plugin UI. | |||
AccessTest | class |
Drupal\ |
core/ |
Tests for the File access control. | |||
AccessTest | class |
Drupal\ |
core/ |
Tests pluggable access for views. | |||
AccessTestBase | abstract class |
Drupal\ |
core/ |
A common test base class for the user access plugin tests. | 1 | ||
AccountEvents | final class |
Drupal\ |
core/ |
Defines events for the account system. | 1 | ||
AccountForm | abstract class |
Drupal\ |
core/ |
Form controller for the user account forms. | 2 | ||
AccountInterface | interface |
Drupal\ |
core/ |
Defines an account interface which represents the current user. | 3 | 367 | |
AccountPermissionsCacheContext | class |
Drupal\ |
core/ |
Defines the AccountPermissionsCacheContext service, for "per permission" caching. | 2 | ||
AccountProxy | class |
Drupal\ |
core/ |
A proxied implementation of AccountInterface. | 1 | 2 | |
AccountProxyInterface | interface |
Drupal\ |
core/ |
Defines an interface for a service which has the current account stored. | 1 | 8 | |
AccountProxyTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Session\AccountProxy @group Session | |||
AccountSetEvent | final class |
Drupal\ |
core/ |
Event fired when an account is set for the current session. | |||
AccountSettingsForm | class |
Drupal\ |
core/ |
Configure user settings for this site. | 2 | 1 | |
AccountSwitcher | class |
Drupal\ |
core/ |
An implementation of AccountSwitcherInterface. | 2 |