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
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\user\Functional core/modules/user/tests/src/Functional/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 11
UserSessionTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/UserSessionTest.php @coversDefaultClass \Drupal\Core\Session\UserSession[[api-linebreak]] @group Session 1 1
UserStorage class Drupal\user core/modules/user/src/UserStorage.php Controller class for users.
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.
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 @coversDefaultClass \Drupal\user\Entity\User[[api-linebreak]] @group 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 7
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.
UserTrackerTab class Drupal\tracker\Plugin\Menu core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php Provides route parameters needed to link to the current user tracker tab. 1
UserTranslationUITest class Drupal\Tests\user\Functional core/modules/user/tests/src/Functional/UserTranslationUITest.php Tests the User Translation UI.
UserUid class Drupal\tracker\Plugin\views\filter core/modules/tracker/src/Plugin/views/filter/UserUid.php UID filter to check for nodes that a user posted or commented on.
UserUid class Drupal\tracker\Plugin\views\argument core/modules/tracker/src/Plugin/views/argument/UserUid.php UID argument to check for nodes that user posted or commented on.
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. 1 1
UserUpdate7002 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.
UserUpdate8002 class Drupal\user\Plugin\migrate\process core/modules/user/src/Plugin/migrate/process/UserUpdate8002.php Keep the predefined roles for rid 1 and 2.
UserUpdateRoleMigrateTest class Drupal\Tests\user\Functional\Update core/modules/user/tests/src/Functional/Update/UserUpdateRoleMigrateTest.php Tests user_update_10000() upgrade path.
UserValidationTest class Drupal\Tests\user\Kernel core/modules/user/tests/src/Kernel/UserValidationTest.php Verify that user validity checks behave as designed.
UserViewsData class Drupal\user core/modules/user/src/UserViewsData.php Provides the views data for the user entity type.
UserViewsDataTest class Drupal\Tests\user\Kernel\Views core/modules/user/tests/src/Kernel/Views/UserViewsDataTest.php Contains tests related to the views data for the user entity type.
UserViewsFieldAccessTest class Drupal\Tests\user\Kernel\Views core/modules/user/tests/src/Kernel/Views/UserViewsFieldAccessTest.php Tests base field access in Views for the user entity.
UserXmlAnonTest class Drupal\Tests\user\Functional\Rest core/modules/user/tests/src/Functional/Rest/UserXmlAnonTest.php @group rest
UserXmlBasicAuthTest class Drupal\Tests\user\Functional\Rest core/modules/user/tests/src/Functional/Rest/UserXmlBasicAuthTest.php @group rest
UserXmlCookieTest class Drupal\Tests\user\Functional\Rest core/modules/user/tests/src/Functional/Rest/UserXmlCookieTest.php @group rest
UsesCommandRequirements class Drupal\BuildTests\Framework\Tests core/tests/Drupal/BuildTests/Framework/Tests/ExternalCommandRequirementTest.php
UsingNonInstalledTraitClass class Drupal\plugin_test\Plugin\plugin_test\custom_annotation core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/custom_annotation/UsingNonInstalledTraitClass.php This class does not have a plugin attribute or plugin annotation on purpose.
Uuid class Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/Uuid.php UUID Helper methods. 8
UuidConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UuidConstraint.php Validates a UUID.
UuidFormatterTest class Drupal\Tests\field\Kernel\KernelString core/modules/field/tests/src/Kernel/KernelString/UuidFormatterTest.php Tests the output of a UUID field.
UuidInterface interface Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/UuidInterface.php Interface for generating UUIDs. 3 11
UuidItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UuidItem.php Defines the 'uuid' entity field type.
UuidItemTest class Drupal\Tests\field\Kernel\KernelString core/modules/field/tests/src/Kernel/KernelString/UuidItemTest.php Tests the UUID field.
UuidReferenceInterface interface Drupal\serialization\EntityResolver core/modules/serialization/src/EntityResolver/UuidReferenceInterface.php Interface for extracting UUID from entity reference data when denormalizing.
UuidResolver class Drupal\serialization\EntityResolver core/modules/serialization/src/EntityResolver/UuidResolver.php Resolves entities from data that contains an entity UUID. 1 2
UuidResolverTest class Drupal\Tests\serialization\Unit\EntityResolver core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php @coversDefaultClass \Drupal\serialization\EntityResolver\UuidResolver[[api-linebreak]] @group serialization
UuidTest class Drupal\Tests\Component\Uuid core/tests/Drupal/Tests/Component/Uuid/UuidTest.php Tests the handling of Universally Unique Identifiers (UUIDs).
UuidValidatorTest class Drupal\KernelTests\Core\Validation core/tests/Drupal/KernelTests/Core/Validation/UuidValidatorTest.php Tests the UUID validator.
ValidateHostnameTest class Drupal\Tests\Core\DrupalKernel core/tests/Drupal/Tests/Core/DrupalKernel/ValidateHostnameTest.php @coversDefaultClass \Drupal\Core\DrupalKernel[[api-linebreak]] @group DrupalKernel
ValidateMigrationStateTest class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/ValidateMigrationStateTest.php Tests the migration state information in module.migrate_drupal.yml.

Other projects


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