Classes, traits, and interfaces - 9.5.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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
PathProcessorTest class Drupal\Tests\Core\PathProcessor core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php Tests processing of the inbound path.
PathProcessorTest class Drupal\url_alter_test core/modules/system/tests/modules/url_alter_test/src/PathProcessorTest.php Path processor for url_alter_test. 2
PathRootsSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/PathRootsSubscriber.php Provides all available first bits of all route paths. 1 2
PathRootsSubscriberTest class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php @coversDefaultClass \Drupal\Core\EventSubscriber\PathRootsSubscriber[[api-linebreak]] @group EventSubscriber
PathSetTranslated class Drupal\path\Plugin\migrate\process core/modules/path/src/Plugin/migrate/process/PathSetTranslated.php A process plugin to update the path of a translated node. 1
PathSetTranslatedTest class Drupal\Tests\path\Unit\migrate\process core/modules/path/tests/src/Unit/migrate/process/PathSetTranslatedTest.php Tests the path_set_translated process plugin.
PathTaxonomyTermTest class Drupal\Tests\path\Functional core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php Tests URL aliases for taxonomy terms.
PathTestBase abstract class Drupal\Tests\path\Functional core/modules/path/tests/src/Functional/PathTestBase.php Provides a base class for testing the Path module. 7
PathValidator class Drupal\Core\Path core/lib/Drupal/Core/Path/PathValidator.php Provides a default path validator and access checker. 1 2
PathValidatorInterface interface Drupal\Core\Path core/lib/Drupal/Core/Path/PathValidatorInterface.php Provides an interface for URL path validators. 1 9
PathValidatorTest class Drupal\Tests\Core\Path core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php @coversDefaultClass \Drupal\Core\Path\PathValidator[[api-linebreak]] @group Routing
PathValidatorTest class Drupal\KernelTests\Core\Path core/tests/Drupal/KernelTests/Core/Path/PathValidatorTest.php Tests the path validator.
PathWidget class Drupal\path\Plugin\Field\FieldWidget core/modules/path/src/Plugin/Field/FieldWidget/PathWidget.php Plugin implementation of the 'path' widget.
PathWorkspacesTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php Tests path aliases with workspaces.
PDOConnection class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/PDOConnection.php SQLite-specific implementation of a PDO connection.
Pecl class Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/Pecl.php Generates a UUID using the PECL extension. 1
PendingRevisionTest class Drupal\Tests\taxonomy\Kernel core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php Kernel tests for taxonomy pending revisions.
Percentage class Drupal\Core\Batch core/lib/Drupal/Core/Batch/Percentage.php Helper methods for the batch system. 2
PercentagesTest class Drupal\Tests\Core\Batch core/tests/Drupal/Tests/Core/Batch/PercentagesTest.php @coversDefaultClass \Drupal\Core\Batch\Percentage[[api-linebreak]] @group Batch
PerComponentEntityDisplay class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityDisplay.php This class imports one component of an entity display.
PerComponentEntityDisplayTest class Drupal\Tests\migrate\Unit\destination core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php Tests the entity display destination plugin.
PerComponentEntityFormDisplay class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/PerComponentEntityFormDisplay.php This class imports one component of an entity form display. 1 1
PerComponentEntityFormDisplayTest class Drupal\Tests\migrate\Unit\destination core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php Tests the entity display destination plugin.
PerformanceForm class Drupal\system\Form core/modules/system/src/Form/PerformanceForm.php Configure performance settings for this site. 1
PerformanceTestRecorder class Drupal\Core\Test core/lib/Drupal/Core/Test/PerformanceTestRecorder.php Records the number of times specific events occur. 3
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 @coversDefaultClass \Drupal\user\Access\PermissionAccessCheck[[api-linebreak]] @group Routing @group Access
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 7
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.
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 @coversDefaultClass \Drupal\Core\Session\PermissionsHashGenerator[[api-linebreak]] @group Session
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.
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
PharExtensionInterceptor

in drupal:9.4.0 and is removed from drupal:10.0.0. No replacement is provided.

class Drupal\Core\Security core/lib/Drupal/Core/Security/PharExtensionInterceptor.php An alternate PharExtensionInterceptor to support phar-based CLI tools. 1
PharWrapperTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/PharWrapperTest.php Tests that the phar stream wrapper works.
PhoneField class Drupal\telephone\Plugin\migrate\field\d7 core/modules/telephone/src/Plugin/migrate/field/d7/PhoneField.php Plugin annotation @MigrateField( id = "phone", type_map = { "phone" = "telephone", }, core = {7}, 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

Other projects


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