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
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 @coversDefaultClass \Drupal\Core\Session\PermissionsHashGenerator[[api-linebreak]] @group Session
PermissionsPerBundle final class Drupal\Core\Config\Action\Plugin\ConfigAction core/lib/Drupal/Core/Config/Action/Plugin/ConfigAction/PermissionsPerBundle.php @internal This API is experimental.
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. 1
PermissionsPerBundleTest class Drupal\KernelTests\Core\Recipe core/tests/Drupal/KernelTests/Core/Recipe/PermissionsPerBundleTest.php @covers \Drupal\Core\Config\Action\Plugin\ConfigAction\PermissionsPerBundle[[api-linebreak]] @covers \Drupal\Core\Config\Action\Plugin\ConfigAction\Deriver\PermissionsPerBundleDeriver[[api-linebreak]]
PermissionsTest class Drupal\Tests\user\Unit\Plugin\views\field core/modules/user/tests/src/Unit/Plugin/views/field/PermissionsTest.php @coversDefaultClass \Drupal\user\Plugin\views\field\Permissions[[api-linebreak]] @group user
PermissionsTest class Drupal\Tests\system\Kernel core/modules/system/tests/src/Kernel/PermissionsTest.php @group system
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.
PgsqlDriverLegacyTest class Drupal\Tests\pgsql\Kernel\pgsql core/modules/pgsql/tests/src/Kernel/pgsql/PgsqlDriverLegacyTest.php Tests the deprecations of the PostgreSQL database driver classes in Core.
PgsqlQueryFactory class Drupal\workspaces\EntityQuery core/modules/workspaces/src/EntityQuery/PgsqlQueryFactory.php Workspaces PostgreSQL-specific entity query implementation. 2
PhoneField class Drupal\telephone\Plugin\migrate\field\d7 core/modules/telephone/src/Plugin/migrate/field/d7/PhoneField.php #[MigrateField(id: 'phone', core: [ 7, ], type_map: [ 'phone' => 'telephone', ], source_module: 'phone', destination_module: 'telephone')]
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.
PhpArrayContainerTest class Drupal\Tests\Component\DependencyInjection core/tests/Drupal/Tests/Component/DependencyInjection/PhpArrayContainerTest.php @coversDefaultClass \Drupal\Component\DependencyInjection\PhpArrayContainer[[api-linebreak]] @group DependencyInjection
PhpArrayDumper class Drupal\Component\DependencyInjection\Dumper core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php PhpArrayDumper dumps a service container as a PHP array.
PhpArrayDumperTest class Drupal\Tests\Component\DependencyInjection\Dumper core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/PhpArrayDumperTest.php @coversDefaultClass \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper[[api-linebreak]] @group DependencyInjection
PhpassHashedPassword class Drupal\phpass\Password core/modules/phpass/src/Password/PhpassHashedPassword.php Legacy password hashing framework. 1 2 2
PhpassHashedPassword

in drupal:10.1.0 and is removed from drupal:11.0.0. The password compatibility service has been moved to the phpass module. Use \Drupal\phpass\Password\PhpassHashedPassword instead.

class Drupal\Core\Password core/lib/Drupal/Core/Password/PhpassHashedPassword.php Deprecated legacy password hashing framework. 1
PhpassHashedPasswordBase abstract class Drupal\Core\Password core/lib/Drupal/Core/Password/PhpassHashedPasswordBase.php Legacy password hashing framework. 2 1
PhpassHashedPasswordLog2BoundariesDouble class Drupal\Tests\phpass\Unit core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php Test double for test coverage of enforceLog2Boundaries().
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 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.
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 @coversDefaultClass \Drupal\Core\Mail\Plugin\Mail\PhpMail[[api-linebreak]] @group Mail
PhpPassword class Drupal\Core\Password core/lib/Drupal/Core/Password/PhpPassword.php Secure PHP password hashing functions. 2 4
PhpPasswordTest class Drupal\Tests\Core\Password core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php Unit tests for password hashing API.
PhpRequirements final class Drupal\Core\Utility core/lib/Drupal/Core/Utility/PhpRequirements.php Provides an object for dynamically identifying the minimum supported PHP. 5
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.
PhpStorageInterface interface Drupal\Component\PhpStorage core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php Stores and loads PHP code. 2 2
PhpStorageTestBase abstract class Drupal\Tests\Component\PhpStorage core/tests/Drupal/Tests/Component/PhpStorage/PhpStorageTestBase.php Base test for PHP storages. 3
PhpStreamWrapperInterface interface Drupal\Core\StreamWrapper core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php Defines a generic PHP stream wrapper interface. 1
PhpTransliteration class Drupal\Core\Transliteration core/lib/Drupal/Core/Transliteration/PhpTransliteration.php Enhances PhpTransliteration with an alter hook. 1 2
PhpTransliteration class Drupal\Component\Transliteration core/lib/Drupal/Component/Transliteration/PhpTransliteration.php Implements transliteration without using the PECL extensions. 1 4
PhpTransliterationTest class Drupal\Tests\Core\Transliteration core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php Tests Transliteration component functionality.
PhpTransliterationTest class Drupal\Tests\Component\Transliteration core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php Tests Transliteration component functionality.
PhpUnitAutoloaderTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitAutoloaderTest.php Tests that classes are correctly loaded during PHPUnit initialization.
PhpUnitBridgeIsolatedTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php Test how unit tests interact with deprecation errors in process isolation.
PhpUnitBridgeRequiresTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeRequiresTest.php Test how unit tests interact with deprecation errors.
PhpUnitBridgeTest class Drupal\FunctionalTests\Core\Test core/tests/Drupal/FunctionalTests/Core/Test/PhpUnitBridgeTest.php Tests Drupal's integration with Symfony PHPUnit Bridge.
PhpUnitBridgeTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php Test how unit tests interact with deprecation errors.

Other projects


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