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
PathAliasForm class Drupal\path core/modules/path/src/PathAliasForm.php Form handler for the path alias edit forms. 1
PathAliasInterface interface Drupal\path_alias core/modules/path_alias/src/PathAliasInterface.php Provides an interface defining a path_alias entity. 1 3
PathAliasJsonAnonTest class Drupal\Tests\path_alias\Functional\Rest core/modules/path_alias/tests/src/Functional/Rest/PathAliasJsonAnonTest.php Test path_alias entities for unauthenticated JSON requests.
PathAliasJsonBasicAuthTest class Drupal\Tests\path_alias\Functional\Rest core/modules/path_alias/tests/src/Functional/Rest/PathAliasJsonBasicAuthTest.php Test path_alias entities for JSON requests via basic auth.
PathAliasJsonCookieTest class Drupal\Tests\path_alias\Functional\Rest core/modules/path_alias/tests/src/Functional/Rest/PathAliasJsonCookieTest.php Test path_alias entities for JSON requests with cookie authentication.
PathAliasListBuilder class Drupal\path core/modules/path/src/PathAliasListBuilder.php Defines a class to build a listing of path_alias entities. 1
PathAliasMenuLinkContentTest class Drupal\Tests\menu_link_content\Kernel core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php Ensures that the menu tree adapts to path alias changes.
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
PathAliasStorage class Drupal\path_alias core/modules/path_alias/src/PathAliasStorage.php Defines the storage handler class for path_alias entities.
PathAliasStorageSchema class Drupal\path_alias core/modules/path_alias/src/PathAliasStorageSchema.php Defines the path_alias schema handler.
PathAliasStorageSchemaTest class Drupal\Tests\path_alias\Kernel core/modules/path_alias/tests/src/Kernel/PathAliasStorageSchemaTest.php Tests the path_alias storage schema.
PathAliasSubscriber class Drupal\path_alias\EventSubscriber core/modules/path_alias/src/EventSubscriber/PathAliasSubscriber.php Provides a path subscriber that converts path aliases. 2
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. 18
PathAliasUpdateTest class Drupal\Tests\path_alias\Functional core/modules/path_alias/tests/src/Functional/PathAliasUpdateTest.php Tests update hooks the path_alias module.
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 @coversDefaultClass \Drupal\system\PathBasedBreadcrumbBuilder[[api-linebreak]] @group system
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. 4
PathChangedHelperTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/PathChangedHelperTest.php @coversDefaultClass \Drupal\Core\Routing\PathChangedHelper[[api-linebreak]] @group Routing
PathChangedHelperTest class Drupal\KernelTests\Core\Routing core/tests/Drupal/KernelTests/Core/Routing/PathChangedHelperTest.php Tests the PathChangedHelper class.
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.
PathFieldDefinitionTest class Drupal\Tests\path\Unit\Field core/modules/path/tests/src/Unit/Field/PathFieldDefinitionTest.php @coversDefaultClass \Drupal\Core\Field\BaseFieldDefinition[[api-linebreak]] @group path
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
PathHooksTest class Drupal\Tests\path_alias\Kernel core/modules/path_alias/tests/src/Kernel/PathHooksTest.php @coversDefaultClass \Drupal\path_alias\Entity\PathAlias[[api-linebreak]]
PathItem class Drupal\path\Plugin\Field\FieldType core/modules/path/src/Plugin/Field/FieldType/PathItem.php Defines the 'path' entity field type. 3
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.
PathMatcher class Drupal\Core\Path core/lib/Drupal/Core/Path/PathMatcher.php Provides a path matcher. 1 2
PathMatcherInterface interface Drupal\Core\Path core/lib/Drupal/Core/Path/PathMatcherInterface.php Provides an interface for URL path matchers. 1 9
PathMatcherTest class Drupal\Tests\Core\Path core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php @coversDefaultClass \Drupal\Core\Path\PathMatcher[[api-linebreak]] @group Path
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 @coversDefaultClass \Drupal\Core\Cache\Context\PathParentCacheContext[[api-linebreak]] @group Cache
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. 3 2
PathPluginBaseTest class Drupal\Tests\views\Unit\Plugin\display core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php @coversDefaultClass \Drupal\views\Plugin\views\display\PathPluginBase[[api-linebreak]] @group views
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

Other projects


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