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
PermissionHandlerInterface interface Drupal\user core/modules/user/src/PermissionHandlerInterface.php Defines an interface to list available permissions. 1 8
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\ProxyClass\Lock core/lib/Drupal/Core/ProxyClass/Lock/PersistentDatabaseLockBackend.php Provides a proxy class for \Drupal\Core\Lock\PersistentDatabaseLockBackend.
PersistentDatabaseLockBackend class Drupal\Core\Lock core/lib/Drupal/Core/Lock/PersistentDatabaseLockBackend.php Defines the persistent database lock backend. 2
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. 4 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
PhpPasswordArgon2idIntegrationTest class Drupal\KernelTests\Core\Password core/tests/Drupal/KernelTests/Core/Password/PhpPasswordArgon2idIntegrationTest.php Argon2id specific integration tests for the PHP password hashing service.
PhpPasswordBcryptIntegrationTest class Drupal\KernelTests\Core\Password core/tests/Drupal/KernelTests/Core/Password/PhpPasswordBcryptIntegrationTest.php Bcrypt specific integration tests for the PHP password hashing service.
PhpPasswordDefaultIntegrationTest class Drupal\KernelTests\Core\Password core/tests/Drupal/KernelTests/Core/Password/PhpPasswordDefaultIntegrationTest.php Integration tests for the PHP password hashing service.
PhpPasswordTest class Drupal\Tests\Core\Password core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php Unit tests for password hashing API.
PhpPasswordUnknownAlgorithmIntegrationTest class Drupal\KernelTests\Core\Password core/tests/Drupal/KernelTests/Core/Password/PhpPasswordUnknownAlgorithmIntegrationTest.php Integration tests for the PHP password hashing service.
PhpRequirements final class Drupal\Core\Utility core/lib/Drupal/Core/Utility/PhpRequirements.php Provides an object for dynamically identifying the minimum supported PHP. 6
PhpRequirementsTest class Drupal\Tests\Core\Utility core/tests/Drupal/Tests/Core/Utility/PhpRequirementsTest.php Tests the \Drupal\Core\Utility\PhpRequirements class.
PhpRequirementTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/PhpRequirementTest.php Tests the output of PHP requirements on the status report.
PhpSelection class Drupal\Core\Entity\Plugin\EntityReferenceSelection core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/PhpSelection.php Defines an alternative to the default Entity Reference Selection plugin.
PhpSerialize class Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/PhpSerialize.php Default serialization for serialized PHP. 4 2
PhpStorageFactory class Drupal\Core\PhpStorage core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php Creates a php storage object. 5
PhpStorageFactoryTest class Drupal\Tests\system\Kernel\PhpStorage core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php Tests the PHP storage factory.

Other projects


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