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
PathAliasResourceTestBase abstract class Drupal\Tests\path_alias\Functional\Rest core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php Base class for path_alias EntityResource tests. 6
PathAliasRevisionIndexesUpdatePathTest class Drupal\Tests\path_alias\Functional\Update core/modules/path_alias/tests/src/Functional/Update/PathAliasRevisionIndexesUpdatePathTest.php Tests the update path for the path_alias_revision table indices.
PathAliasStorage class Drupal\path_alias core/modules/path_alias/src/PathAliasStorage.php Defines the storage handler class for path_alias entities. 1
PathAliasStorageSchema class Drupal\path_alias core/modules/path_alias/src/PathAliasStorageSchema.php Defines the path_alias schema handler. 2
PathAliasStorageSchemaTest class Drupal\Tests\path_alias\Kernel core/modules/path_alias/tests/src/Kernel/PathAliasStorageSchemaTest.php Tests the path_alias storage schema.
PathAliasTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/PathAliasTest.php JSON:API integration test for the "PathAlias" content entity type.
PathAliasTest class Drupal\Tests\path\Functional core/modules/path/tests/src/Functional/PathAliasTest.php Tests modifying path aliases from the UI.
PathAliasTestTrait trait Drupal\Tests\Traits\Core core/tests/Drupal/Tests/Traits/Core/PathAliasTestTrait.php Provides methods to create and assert path_alias entities. 19
PathAliasXmlAnonTest class Drupal\Tests\path_alias\Functional\Rest core/modules/path_alias/tests/src/Functional/Rest/PathAliasXmlAnonTest.php Test path_alias entities for unauthenticated XML requests.
PathAliasXmlBasicAuthTest class Drupal\Tests\path_alias\Functional\Rest core/modules/path_alias/tests/src/Functional/Rest/PathAliasXmlBasicAuthTest.php Test path_alias entities for XML requests with cookie authentication.
PathAliasXmlCookieTest class Drupal\Tests\path_alias\Functional\Rest core/modules/path_alias/tests/src/Functional/Rest/PathAliasXmlCookieTest.php Test path_alias entities for XML requests.
PathBasedBreadcrumbBuilder class Drupal\system core/modules/system/src/PathBasedBreadcrumbBuilder.php Defines a class to build path-based breadcrumbs. 1 1 2
PathBasedBreadcrumbBuilderTest class Drupal\Tests\system\Unit\Breadcrumbs core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php Tests Drupal\system\PathBasedBreadcrumbBuilder.
PathCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/PathCacheContext.php Defines the PathCacheContext service, for "per URL path" caching. 2
PathChangedHelper class Drupal\Core\Routing core/lib/Drupal/Core/Routing/PathChangedHelper.php Provides helper functions for handling path changes. 2
PathChangedHelperTest class Drupal\KernelTests\Core\Routing core/tests/Drupal/KernelTests/Core/Routing/PathChangedHelperTest.php Tests the PathChangedHelper class.
PathChangedHelperTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/PathChangedHelperTest.php Tests Drupal\Core\Routing\PathChangedHelper.
PathContentModerationTest class Drupal\Tests\path\Functional core/modules/path/tests/src/Functional/PathContentModerationTest.php Tests path aliases with Content Moderation.
PathElement class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/PathElement.php Provides a matched path render element. 2
PathElementFormTest class Drupal\KernelTests\Core\Element core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php Tests PathElement validation and conversion functionality.
PathEncodedTest class Drupal\FunctionalTests\Routing core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php Tests URL generation and routing for route paths with encoded characters.
PathEncodedTestController class Drupal\path_encoded_test\Controller core/modules/system/tests/modules/path_encoded_test/src/Controller/PathEncodedTestController.php Returns responses for path_encoded_test routes.
PathExtractor class Drupal\Core\Theme\Plugin\IconExtractor core/lib/Drupal/Core/Theme/Plugin/IconExtractor/PathExtractor.php Plugin implementation of the icon_extractor. 1
PathExtractorTest class Drupal\Tests\Core\Theme\Icon\Plugin core/tests/Drupal/Tests/Core/Theme/Icon/Plugin/PathExtractorTest.php Tests Drupal\Core\Theme\Plugin\IconExtractor\PathExtractor.
PathFieldDefinitionTest class Drupal\Tests\path\Unit\Field core/modules/path/tests/src/Unit/Field/PathFieldDefinitionTest.php Tests Drupal\Core\Field\BaseFieldDefinition.
PathFieldItemList class Drupal\path\Plugin\Field\FieldType core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php Represents a configurable entity path field.
PathFilterForm class Drupal\path\Form core/modules/path/src/Form/PathFilterForm.php Provides the path admin overview filter form. 1
PathHooks class Drupal\path\Hook core/modules/path/src/Hook/PathHooks.php Hook implementations for path.
PathHooksTest class Drupal\Tests\path_alias\Kernel core/modules/path_alias/tests/src/Kernel/PathHooksTest.php Tests Drupal\path_alias\Entity\PathAlias.
PathItem class Drupal\path\Plugin\Field\FieldType core/modules/path/src/Plugin/Field/FieldType/PathItem.php Defines the 'path' entity field type. 4
PathItemTest class Drupal\Tests\path\Kernel core/modules/path/tests/src/Kernel/PathItemTest.php Tests loading and storing data using PathItem.
PathLanguageTest class Drupal\Tests\path\Functional core/modules/path/tests/src/Functional/PathLanguageTest.php Confirm that paths work with translated nodes.
PathLanguageUiTest class Drupal\Tests\path\Functional core/modules/path/tests/src/Functional/PathLanguageUiTest.php Confirm that the Path module user interface works with languages.
PathLocator class Drupal\package_manager core/modules/package_manager/src/PathLocator.php Computes file system paths that are needed to stage code changes. 1 58
PathLocatorTest class Drupal\Tests\package_manager\Unit core/modules/package_manager/tests/src/Unit/PathLocatorTest.php Tests Drupal\package_manager\PathLocator.
PathMatcher class Drupal\Core\Path core/lib/Drupal/Core/Path/PathMatcher.php Provides a path matcher. 1 2 2
PathMatcherInterface interface Drupal\Core\Path core/lib/Drupal/Core/Path/PathMatcherInterface.php Provides an interface for URL path matchers. 2 15
PathMatcherTest class Drupal\Tests\Core\Path core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php Tests Drupal\Core\Path\PathMatcher.
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

Other projects


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