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
PerformanceTest class Drupal\Tests\navigation\FunctionalJavascript core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php Tests performance with the navigation toolbar enabled.
PerformanceTestBase abstract class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/PerformanceTestBase.php Collects performance metrics. 10 10
PerformanceTestRecorder class Drupal\Core\Test core/lib/Drupal/Core/Test/PerformanceTestRecorder.php Records the number of times specific events occur. 3
PerformanceTestTrait trait Drupal\Tests core/tests/Drupal/Tests/PerformanceTestTrait.php Provides various methods to aid in collecting performance data during tests. 1
Permission class Drupal\user\Plugin\views\access core/modules/user/src/Plugin/views/access/Permission.php Access plugin that provides permission-based access control. 1
PermissionAccessCheck class Drupal\user\Access core/modules/user/src/Access/PermissionAccessCheck.php Permission access check. 1 2
PermissionAccessCheckTest class Drupal\Tests\user\Unit core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php Tests Drupal\user\Access\PermissionAccessCheck.
PermissionChecker class Drupal\Core\Session core/lib/Drupal/Core/Session/PermissionChecker.php Checks permissions for an account. 1 2
PermissionCheckerInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/PermissionCheckerInterface.php Defines a permission checker interface. 1
PermissionCheckerTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/PermissionCheckerTest.php Tests Drupal\Core\Session\PermissionChecker.
PermissionFilterTest class Drupal\Tests\user\FunctionalJavascript core/modules/user/tests/src/FunctionalJavascript/PermissionFilterTest.php Tests the JavaScript functionality of the permission filter.
PermissionHandler class Drupal\user core/modules/user/src/PermissionHandler.php Provides the available permissions based on yml files. 1 2
PermissionHandlerInterface interface Drupal\user core/modules/user/src/PermissionHandlerInterface.php Defines an interface to list available permissions. 1 10
PermissionHandlerTest class Drupal\Tests\user\Unit core/modules/user/tests/src/Unit/PermissionHandlerTest.php Tests the permission handler.
Permissions class Drupal\user\Plugin\views\field core/modules/user/src/Plugin/views/field/Permissions.php Field handler to provide a list of permissions. 1
Permissions class Drupal\user\Plugin\views\filter core/modules/user/src/Plugin/views/filter/Permissions.php Filter handler for user roles.
Permissions class Drupal\content_moderation core/modules/content_moderation/src/Permissions.php Defines a class for dynamic permissions based on transitions. 1
PermissionsHashGenerator class Drupal\Core\Session core/lib/Drupal/Core/Session/PermissionsHashGenerator.php Generates and caches the permissions hash for a user. 1 2
PermissionsHashGeneratorInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/PermissionsHashGeneratorInterface.php Defines the user permissions hash generator interface. 1 1
PermissionsHashGeneratorTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php Tests Drupal\Core\Session\PermissionsHashGenerator.
PermissionsPerBundle final class Drupal\Core\Config\Action\Plugin\ConfigAction core/lib/Drupal/Core/Config/Action/Plugin/ConfigAction/PermissionsPerBundle.php @internal This API is experimental. 1
PermissionsPerBundleDeriver final class Drupal\Core\Config\Action\Plugin\ConfigAction\Deriver core/lib/Drupal/Core/Config/Action/Plugin/ConfigAction/Deriver/PermissionsPerBundleDeriver.php @internal This API is experimental. 2
PermissionsPerBundleTest class Drupal\KernelTests\Core\Recipe core/tests/Drupal/KernelTests/Core/Recipe/PermissionsPerBundleTest.php Tests Permissions Per Bundle.
PermissionsTest class Drupal\Tests\user\Unit\Plugin\views\field core/modules/user/tests/src/Unit/Plugin/views/field/PermissionsTest.php Tests Drupal\user\Plugin\views\field\Permissions.
PermissionsTest class Drupal\Tests\system\Kernel core/modules/system/tests/src/Kernel/PermissionsTest.php Tests Permissions.
PersistentDatabaseLockBackend class Drupal\Core\Lock core/lib/Drupal/Core/Lock/PersistentDatabaseLockBackend.php Defines the persistent database lock backend. 2
PersistentDatabaseLockBackend class Drupal\Core\ProxyClass\Lock core/lib/Drupal/Core/ProxyClass/Lock/PersistentDatabaseLockBackend.php Provides a proxy class for \Drupal\Core\Lock\PersistentDatabaseLockBackend.
PgsqlCastedIntFieldJoinTest class Drupal\Tests\pgsql\Kernel\pgsql\Plugin\views core/modules/pgsql/tests/src/Kernel/pgsql/Plugin/views/PgsqlCastedIntFieldJoinTest.php Tests PostgreSQL specific cast handling.
PgsqlHooks class Drupal\pgsql\Hook core/modules/pgsql/src/Hook/PgsqlHooks.php Hook implementations for pgsql.
PgsqlQueryFactory class Drupal\workspaces\EntityQuery core/modules/workspaces/src/EntityQuery/PgsqlQueryFactory.php Workspaces PostgreSQL-specific entity query implementation.
PgsqlRequirements class Drupal\pgsql\Install\Requirements core/modules/pgsql/src/Install/Requirements/PgsqlRequirements.php Install time requirements for the pgsql module. 1
PgsqlRequirementsHooks class Drupal\pgsql\Hook core/modules/pgsql/src/Hook/PgsqlRequirementsHooks.php Hook implementations for pgsql module.
PhoneField class Drupal\telephone\Plugin\migrate\field\d7 core/modules/telephone/src/Plugin/migrate/field/d7/PhoneField.php Migrate field plugin for Drupal 7 phone fields.
Php class Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/Php.php Generates a UUID v4 (RFC 4122 section 4.4) using PHP code. 5 2
PhpArrayContainer class Drupal\Component\DependencyInjection core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php Provides a container optimized for Drupal's needs. 1
PhpArrayContainerTest class Drupal\Tests\Component\DependencyInjection core/tests/Drupal/Tests/Component/DependencyInjection/PhpArrayContainerTest.php Tests Drupal\Component\DependencyInjection\PhpArrayContainer.
PhpArrayDumper class Drupal\Component\DependencyInjection\Dumper core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php PhpArrayDumper dumps a service container as a PHP array. 1
PhpArrayDumperTest class Drupal\Tests\Component\DependencyInjection\Dumper core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php Tests Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper.
PhpassHashedPassword class Drupal\phpass\Password core/modules/phpass/src/Password/PhpassHashedPassword.php Legacy password hashing framework. 1 1 2
PhpassHashedPasswordBase abstract class Drupal\Core\Password core/lib/Drupal/Core/Password/PhpassHashedPasswordBase.php Legacy password hashing framework. 1 1
PhpassHashedPasswordLog2BoundariesDouble class Drupal\Tests\phpass\Unit core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php Test double for test coverage of enforceLog2Boundaries().
PhpassHooks class Drupal\phpass\Hook core/modules/phpass/src/Hook/PhpassHooks.php Hook implementations for phpass.
PhpBackend class Drupal\Core\Cache core/lib/Drupal/Core/Cache/PhpBackend.php Defines a PHP cache implementation. 2
PhpBackendFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/PhpBackendFactory.php Defines a PHP cache backend factory. 2
PhpBackendTest class Drupal\KernelTests\Core\Cache core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php Unit test of the PHP cache backend using the generic cache unit test base.
PhpExtensionsValidator class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/PhpExtensionsValidator.php Performs validation if certain PHP extensions are enabled. 1
PhpExtensionsValidatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/PhpExtensionsValidatorTest.php Tests Php Extensions Validator.
PhpMail class Drupal\Core\Mail\Plugin\Mail core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php Defines the default Drupal mail backend, using PHP's native mail() function. 2 2
PhpMailTest class Drupal\Tests\Core\Mail\Plugin\Mail core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php Tests Drupal\Core\Mail\Plugin\Mail\PhpMail.
PhpPassword class Drupal\Core\Password core/lib/Drupal/Core/Password/PhpPassword.php Secure PHP password hashing functions. 6 4

Other projects


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