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
UserRegistrationTest class Drupal\Tests\user\Functional core/modules/user/tests/src/Functional/UserRegistrationTest.php Tests registration of user under different configurations.
UserRememberRolesFilterSettingTest class Drupal\Tests\views\Functional\Update core/modules/views/tests/src/Functional/Update/UserRememberRolesFilterSettingTest.php Tests the upgrade path for the clean-up of empty remember_roles display settings for views filters.
UserRequestSubscriber class Drupal\user\EventSubscriber core/modules/user/src/EventSubscriber/UserRequestSubscriber.php Updates the current user's last access time. 2
UserRequirements class Drupal\user\Hook core/modules/user/src/Hook/UserRequirements.php Requirements for the User module.
UserRequirementsTest class Drupal\Tests\user\Kernel core/modules/user/tests/src/Kernel/UserRequirementsTest.php Tests user_requirements().
UserRequirementsTest class Drupal\Tests\user\Functional core/modules/user/tests/src/Functional/UserRequirementsTest.php Tests the requirements checks of the User module.
UserResourceTestBase abstract class Drupal\Tests\user\Functional\Rest core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php Resource test base for the user entity. 6
UserRole class Drupal\user\Plugin\Condition core/modules/user/src/Plugin/Condition/UserRole.php Provides a 'User Role' condition.
UserRoleAdminTest class Drupal\Tests\user\Functional core/modules/user/tests/src/Functional/UserRoleAdminTest.php Tests adding, editing and deleting user roles and changing role weights.
UserRoleConditionTest class Drupal\Tests\user\Kernel\Condition core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php Tests the user role condition.
UserRoleDeleteTest class Drupal\Tests\user\Kernel core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php Tests the handling of user_role entity from the user module.
UserRoleEntityTest class Drupal\Tests\user\Kernel core/modules/user/tests/src/Kernel/UserRoleEntityTest.php Tests Drupal\user\Entity\Role.
UserRolesAccessPolicy final class Drupal\Core\Session core/lib/Drupal/Core/Session/UserRolesAccessPolicy.php Grants permissions based on a user's roles. 1 2
UserRolesAccessPolicyTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/UserRolesAccessPolicyTest.php Tests Drupal\Core\Session\UserRolesAccessPolicy.
UserRolesAssignmentTest class Drupal\Tests\user\Functional core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php Tests that users can be assigned and unassigned roles.
UserRolesCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/UserRolesCacheContext.php Defines the UserRolesCacheContext service, for "per role" caching. 1 2
UserRolesCacheContextTest class Drupal\Tests\Core\Cache\Context core/tests/Drupal/Tests/Core/Cache/Context/UserRolesCacheContextTest.php Tests Drupal\Core\Cache\Context\UserRolesCacheContext.
UserRolesPermissionsTest class Drupal\KernelTests\Core\Session core/tests/Drupal/KernelTests/Core/Session/UserRolesPermissionsTest.php Test case for getting permissions from user roles.
UserRoleTest class Drupal\Tests\user\Kernel\Views core/modules/user/tests/src/Kernel/Views/UserRoleTest.php Tests rendering when the role is numeric.
UserRouteAlterSubscriber class Drupal\serialization\EventSubscriber core/modules/serialization/src/EventSubscriber/UserRouteAlterSubscriber.php Alters user authentication routes to support added serialization formats. 2
UserRouteAlterTest class Drupal\Tests\serialization\Kernel core/modules/serialization/tests/src/Kernel/UserRouteAlterTest.php Tests that the user routes can be altered.
UserRouteProvider class Drupal\user\Entity core/modules/user/src/Entity/UserRouteProvider.php Provides routes for the user entity.
UserRow class Drupal\user\Plugin\views\row core/modules/user/src/Plugin/views/row/UserRow.php A row plugin which renders a user.
Users class Drupal\user\Plugin\views\wizard core/modules/user/src/Plugin/views/wizard/Users.php Tests creating user views with the wizard.
UserSaveStatusTest class Drupal\Tests\user\Kernel core/modules/user/tests/src/Kernel/UserSaveStatusTest.php Tests user saving status.
UserSaveTest class Drupal\Tests\user\Kernel core/modules/user/tests/src/Kernel/UserSaveTest.php Tests account saving for arbitrary new uid.
UserSearch class Drupal\user\Plugin\Search core/modules/user/src/Plugin/Search/UserSearch.php Executes a keyword search for users against the {users} database table.
UserSearchTest class Drupal\Tests\search\Functional\user core/modules/search/tests/src/Functional/user/UserSearchTest.php Verifies that sensitive information is hidden from unauthorized users.
UserSelection class Drupal\user\Plugin\EntityReferenceSelection core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php Provides specific access control for the user entity type.
UserSession class Drupal\Core\Session core/lib/Drupal/Core/Session/UserSession.php An implementation of the user account interface for the global user. 1 12
UserSessionRepository class Drupal\Core\Session core/lib/Drupal/Core/Session/UserSessionRepository.php Provides the default user session repository. 2
UserSessionRepositoryInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/UserSessionRepositoryInterface.php Provides an interface for the user session repository. 1 2
UserSessionTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/UserSessionTest.php Tests Drupal\Core\Session\UserSession.
UserStorage class Drupal\user core/modules/user/src/UserStorage.php Controller class for users. 1
UserStorageInterface interface Drupal\user core/modules/user/src/UserStorageInterface.php Defines an interface for user entity storage classes. 1 9
UserStorageSchema class Drupal\user core/modules/user/src/UserStorageSchema.php Defines the user schema handler. 1
UserSubAdminTest class Drupal\Tests\user\Functional core/modules/user/tests/src/Functional/UserSubAdminTest.php Test 'sub-admin' account with permission to edit some users but without 'administer users' permission.
UserTest class Drupal\Tests\user\Unit\Plugin\Core\Entity core/modules/user/tests/src/Unit/Plugin/Core/Entity/UserTest.php Tests Drupal\user\Entity\User.
UserTest class Drupal\Tests\user\Kernel\Plugin\migrate\source\d6 core/modules/user/tests/src/Kernel/Plugin/migrate/source/d6/UserTest.php Tests the d6_user source plugin.
UserTest class Drupal\Tests\user\Kernel\Plugin\migrate\source\d7 core/modules/user/tests/src/Kernel/Plugin/migrate/source/d7/UserTest.php Tests the d7_user source plugin.
UserTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/UserTest.php JSON:API integration test for the "User" content entity type.
UserTestBase abstract class Drupal\Tests\user\Functional\Views core/modules/user/tests/src/Functional/Views/UserTestBase.php Base test class for user-related Views tests. 7
UserThemeHooks class Drupal\user\Hook core/modules/user/src/Hook/UserThemeHooks.php Hook implementations for user. 1
UserTimeZoneTest class Drupal\Tests\user\Functional core/modules/user/tests/src/Functional/UserTimeZoneTest.php Set a user time zone and verify that dates are displayed in local time.
UserTokenReplaceTest class Drupal\Tests\user\Functional core/modules/user/tests/src/Functional/UserTokenReplaceTest.php Tests the replacement of user tokens.
UserTokensHooks class Drupal\user\Hook core/modules/user/src/Hook/UserTokensHooks.php Hook implementations for user.
UserTranslationUITest class Drupal\Tests\user\Functional core/modules/user/tests/src/Functional/UserTranslationUITest.php Tests the User Translation UI.
UserUid class Drupal\comment\Plugin\views\filter core/modules/comment/src/Plugin/views/filter/UserUid.php Filter handler, accepts user ID to check for nodes user posted/commented on.
UserUid class Drupal\comment\Plugin\views\argument core/modules/comment/src/Plugin/views/argument/UserUid.php The views user ID argument handler.
UserUpdate7002

in drupal:11.3.0 and is removed from drupal:12.0.0. There is no replacement.

class Drupal\user\Plugin\migrate\process\d6 core/modules/user/src/Plugin/migrate/process/d6/UserUpdate7002.php Converts user time zones from time zone offsets to time zone names.

Other projects


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