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
AjaxTestImageEffect class Drupal\image_module_test\Plugin\ImageEffect core/modules/image/tests/modules/image_module_test/src/Plugin/ImageEffect/AjaxTestImageEffect.php Provides a test effect using Ajax in the configuration form.
AjaxTestMessageCommandForm class Drupal\ajax_test\Form core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestMessageCommandForm.php Form for testing AJAX MessageCommand. 1
AjaxWaitTest class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/AjaxWaitTest.php Tests that unnecessary or untracked XHRs will cause a test failure.
AlertCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/AlertCommand.php AJAX command for a javascript alert box. 5
AlertsJsonFeedTest class Drupal\Tests\announcements_feed\Functional core/modules/announcements_feed/tests/src/Functional/AlertsJsonFeedTest.php Test the access announcement according to json feed changes.
AlertsJsonFeedTest class Drupal\Tests\announcements_feed\FunctionalJavascript core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php Test the access announcement according to json feed changes.
AliasingResourceTypeRepository class Drupal\jsonapi_test_field_aliasing\ResourceType core/modules/jsonapi/tests/modules/jsonapi_test_field_aliasing/src/ResourceType/AliasingResourceTypeRepository.php Provides a repository of resource types with field names that can be aliased. 2
AliasManager class Drupal\path_alias core/modules/path_alias/src/AliasManager.php The default alias manager implementation. 4 2
AliasManagerInterface interface Drupal\path_alias core/modules/path_alias/src/AliasManagerInterface.php Find an alias for a path and vice versa. 2 10
AliasManagerTest class Drupal\Tests\path_alias\Unit core/modules/path_alias/tests/src/Unit/AliasManagerTest.php Tests Drupal\path_alias\AliasManager.
AliasPathMatcher class Drupal\path_alias core/modules/path_alias/src/AliasPathMatcher.php Extends the default path matcher to check aliases.
AliasPathProcessor class Drupal\path_alias\PathProcessor core/modules/path_alias/src/PathProcessor/AliasPathProcessor.php Processes the inbound and outbound path using path alias lookups. 3 2
AliasPathProcessorTest class Drupal\Tests\path_alias\Unit\PathProcessor core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php Tests Drupal\path_alias\PathProcessor\AliasPathProcessor.
AliasPrefixList class Drupal\path_alias core/modules/path_alias/src/AliasPrefixList.php Cache a list of valid alias prefixes. 1 1 2
AliasPrefixListInterface interface Drupal\path_alias core/modules/path_alias/src/AliasPrefixListInterface.php Cache a list of valid alias prefixes. 2 1
AliasRepository class Drupal\path_alias core/modules/path_alias/src/AliasRepository.php Provides the default path alias lookup operations. 1 2 2
AliasRepositoryInterface interface Drupal\path_alias core/modules/path_alias/src/AliasRepositoryInterface.php Provides an interface for path alias lookup operations. 1 1
AliasTest class Drupal\Tests\path_alias\Kernel core/modules/path_alias/tests/src/Kernel/AliasTest.php Tests path alias CRUD and lookup functionality.
AliasWhitelist

in drupal:11.1.0 and is removed from drupal:12.0.0. Use \Drupal\path_alias\AliasPrefixList instead.

class Drupal\path_alias core/modules/path_alias/src/AliasWhitelist.php Cache a list of valid alias prefixes.
AliasWhitelistInterface

in drupal:11.1.0 and is removed from drupal:12.0.0. Use \Drupal\path_alias\AliasPrefixListInterface instead.

interface Drupal\path_alias core/modules/path_alias/src/AliasWhitelistInterface.php Cache a list of valid alias prefixes.
Alignment class Drupal\ckeditor5\Plugin\CKEditor5Plugin core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Alignment.php CKEditor 5 Alignment plugin. 1 1
AlignmentPluginTest class Drupal\Tests\ckeditor5\Unit core/modules/ckeditor5/tests/src/Unit/AlignmentPluginTest.php Tests Drupal\ckeditor5\Plugin\CKEditor5Plugin\Alignment.
AllExceptHostEntity class Drupal\entity_reference_test\Plugin\EntityReferenceSelection core/modules/system/tests/modules/entity_reference_test/src/Plugin/EntityReferenceSelection/AllExceptHostEntity.php Allows access to all entities except for the host entity.
AllowDirectWrite final class Drupal\package_manager\Attribute core/modules/package_manager/src/Attribute/AllowDirectWrite.php Identifies sandbox managers which can operate on the running code base. 3
AllowedPackages class Drupal\Composer\Plugin\Scaffold composer/Plugin/Scaffold/AllowedPackages.php Determine recursively which packages have been allowed to scaffold files.
AllowedScaffoldPackagesValidator final class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/AllowedScaffoldPackagesValidator.php Validates the list of packages that are allowed to scaffold files. 1
AllowedScaffoldPackagesValidatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/AllowedScaffoldPackagesValidatorTest.php Tests Allowed Scaffold Packages Validator.
AllowedValuesConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/AllowedValuesConstraint.php Checks for the value being allowed. 1
AllowedValuesConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/AllowedValuesConstraintValidator.php Validates the AllowedValues constraint.
AllowedValuesConstraintValidatorTest class Drupal\KernelTests\Core\TypedData core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php Tests AllowedValues validation constraint with both valid and invalid values.
AllowListConfigStorage final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/AllowListConfigStorage.php A read-only storage wrapper that only allows access to certain config names.
AllowToolbarPath class Drupal\toolbar\PageCache core/modules/toolbar/src/PageCache/AllowToolbarPath.php Cache policy for the toolbar page cache service. 1 2
AllowToolbarPathTest class Drupal\Tests\toolbar\Unit\PageCache core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php Tests Drupal\toolbar\PageCache\AllowToolbarPath.
AlreadyInstalledException class Drupal\Core\Installer\Exception core/lib/Drupal/Core/Installer/Exception/AlreadyInstalledException.php Exception thrown if Drupal is installed already. 1
AlterableInterface interface Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/AlterableInterface.php Interface for a query that can be manipulated via an alter hook. 2 15
AlterContentMiddleware final class Drupal\http_middleware_test\StackMiddleware core/modules/system/tests/modules/http_middleware_test/src/StackMiddleware/AlterContentMiddleware.php Alters the response before content length is calculated. 2
AlterTest class Drupal\Tests\system\Kernel\Common core/modules/system/tests/src/Kernel/Common/AlterTest.php Tests alteration of arguments passed to \Drupal::moduleHandler->alter().
AlterTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/AlterTest.php Tests hook_form_alter() and hook_form_FORM_ID_alter().
AlterTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/AlterTest.php Tests the hook_query_alter capabilities of the Select builder.
AltTextContainsLlamasConstraint final class Drupal\image_field_property_constraint_validation\Plugin\Validation\Constraint core/modules/image/tests/modules/image_field_property_constraint_validation/src/Plugin/Validation/Constraint/AltTextContainsLlamasConstraint.php Provides a Contains Llamas constraint.
AltTextContainsLlamasConstraintValidator final class Drupal\image_field_property_constraint_validation\Plugin\Validation\Constraint core/modules/image/tests/modules/image_field_property_constraint_validation/src/Plugin/Validation/Constraint/AltTextContainsLlamasConstraintValidator.php Validates the alt text contains llamas.
AlwaysAddsAccessPolicy class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php A test access policy that adds a permission.
AlwaysAltersAccessPolicy class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php A test access policy that alters an existing policy.
AmbiguousBundleClassException class Drupal\Core\Entity\Exception core/lib/Drupal/Core/Entity/Exception/AmbiguousBundleClassException.php Exception thrown if a bundle class is defined for multiple bundles. 3
AmbiguousEntityClassException class Drupal\Core\Entity\Exception core/lib/Drupal/Core/Entity/Exception/AmbiguousEntityClassException.php Exception thrown if multiple entity types exist for an entity class. 1 2
AMissingTargetAlter class Drupal\aaa_hook_order_test\Hook core/modules/system/tests/modules/HookOrder/aaa_hook_order_test/src/Hook/AMissingTargetAlter.php Provides hook implementations for testing the alteration of hooks. 2
AMissingTargetHooks class Drupal\aaa_hook_order_test\Hook core/modules/system/tests/modules/HookOrder/aaa_hook_order_test/src/Hook/AMissingTargetHooks.php Contains hook implementations. 2
Analyze class Drupal\views_ui\Form\Ajax core/modules/views_ui/src/Form/Ajax/Analyze.php Displays analysis information for a view.
Analyzer class Drupal\views core/modules/views/src/Analyzer.php View analyzer plugin manager. 4 2
AnalyzeTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/AnalyzeTest.php Tests the views analyze system.

Other projects


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