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
PathMediaFormTest class Drupal\Tests\path\Functional core/modules/path/tests/src/Functional/PathMediaFormTest.php Tests the path media form UI.
PathNoCanonicalLinkTest class Drupal\Tests\path\Kernel core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php Tests path alias deletion when there is no canonical link template.
PathNodeFormTest class Drupal\Tests\path\Functional core/modules/path/tests/src/Functional/PathNodeFormTest.php Tests the Path Node form UI.
PathParentCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/PathParentCacheContext.php Defines a cache context service for path parents. 1 2
PathParentCacheContextTest class Drupal\Tests\Core\Cache\Context core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php Tests Drupal\Core\Cache\Context\PathParentCacheContext.
PathPluginBase abstract class Drupal\views\Plugin\views\display core/modules/views/src/Plugin/views/display/PathPluginBase.php The base display plugin for path/callbacks. This is used for pages and feeds. 4 4
PathPluginBaseStub class Drupal\Tests\views\Unit\Plugin\display core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseStub.php Provides a basic class extending PathPluginBase for testing.
PathPluginBaseTest class Drupal\Tests\views\Unit\Plugin\display core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php Tests Drupal\views\Plugin\views\display\PathPluginBase.
PathPluginTest class Drupal\Tests\node\Kernel\Views core/modules/node/tests/src/Kernel/Views/PathPluginTest.php Tests the node row plugin.
PathProcessorDecode class Drupal\Core\PathProcessor core/lib/Drupal/Core/PathProcessor/PathProcessorDecode.php Processes the inbound path by decoding the URL. 1 2
PathProcessorFiles class Drupal\system\PathProcessor core/modules/system/src/PathProcessor/PathProcessorFiles.php Defines a path processor to rewrite file URLs. 2
PathProcessorFront class Drupal\Core\PathProcessor core/lib/Drupal/Core/PathProcessor/PathProcessorFront.php Processes the inbound path by resolving it to the front page if empty. 2 2
PathProcessorFrontTest class Drupal\Tests\Core\PathProcessor core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php Test front page path processing.
PathProcessorImageStyles class Drupal\image\PathProcessor core/modules/image/src/PathProcessor/PathProcessorImageStyles.php Defines a path processor to rewrite image styles URLs. 2
PathProcessorLanguage class Drupal\language\HttpKernel core/modules/language/src/HttpKernel/PathProcessorLanguage.php Processes the inbound path using path alias lookups. 2
PathProcessorManager class Drupal\Core\PathProcessor core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php Path processor manager. 3 2
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 Tests Drupal\Core\EventSubscriber\PathRootsSubscriber.
PathSetTranslated

in drupal:11.3.0 and is removed from drupal:12.0.0. There is no replacement.

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. 8
PathTestMiscHooks class Drupal\path_test_misc\Hook core/modules/path/tests/modules/path_test_misc/src/Hook/PathTestMiscHooks.php Hook implementations for path_test_misc.
PathTestNodeGrantsHooks class Drupal\path_test_node_grants\Hook core/modules/path/tests/modules/path_test_node_grants/src/Hook/PathTestNodeGrantsHooks.php Hook implementations for path_test_node_grants.
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 16
PathValidatorTest class Drupal\Tests\Core\Path core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php Tests Drupal\Core\Path\PathValidator.
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.
PathWithNodeAccessGrantsTest class Drupal\Tests\path\Functional core/modules/path/tests/src/Functional/PathWithNodeAccessGrantsTest.php Confirm that paths work with node access grants implementations.
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.
PdoResult class Drupal\Core\Database\Statement core/lib/Drupal/Core/Database/Statement/PdoResult.php Class for PDO-provided results of a data query language (DQL) statement. 1
PdoTrait trait Drupal\Core\Database\Statement core/lib/Drupal/Core/Database/Statement/PdoTrait.php A trait for calling \PDOStatement methods. 2
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.
PendingUpdatesValidator final class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/PendingUpdatesValidator.php Validates that there are no pending database updates. 1
PendingUpdatesValidatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/PendingUpdatesValidatorTest.php Tests Pending Updates Validator.
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 Tests the Batch helper object.
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.
PerformanceController class Drupal\system\Controller core/modules/system/src/Controller/PerformanceController.php Controller for performance admin.
PerformanceData class Drupal\Tests core/tests/Drupal/Tests/PerformanceData.php Value object to store performance information collected from requests.
PerformanceDataCollector class Drupal\performance_test core/modules/system/tests/modules/performance_test/src/PerformanceDataCollector.php Collects and stores performance data for database and cache operations. 3
PerformanceForm class Drupal\system\Form core/modules/system/src/Form/PerformanceForm.php Configure performance settings for this site. 1

Other projects


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