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
ChainedFastBackendFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php Defines the chained fast cache backend factory. 1 2
ChainedFastBackendFactoryTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendFactoryTest.php Tests Drupal\Core\Cache\ChainedFastBackendFactory.
ChainedFastBackendTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php Tests Drupal\Core\Cache\ChainedFastBackend.
ChainedFastBackendTest class Drupal\KernelTests\Core\Cache core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php Unit test of the fast chained backend using the generic cache unit test base.
ChainedPlaceholderStrategy class Drupal\Core\Render\Placeholder core/lib/Drupal/Core/Render/Placeholder/ChainedPlaceholderStrategy.php Renders placeholders using a chain of placeholder strategies. 1 2
ChainedPlaceholderStrategyTest class Drupal\Tests\Core\Render\Placeholder core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php Tests Drupal\Core\Render\Placeholder\ChainedPlaceholderStrategy.
ChainEntityResolver class Drupal\serialization\EntityResolver core/modules/serialization/src/EntityResolver/ChainEntityResolver.php Resolver delegating the entity resolution to a chain of resolvers. 1 2
ChainEntityResolverInterface interface Drupal\serialization\EntityResolver core/modules/serialization/src/EntityResolver/ChainEntityResolverInterface.php An interface for delegating an entity resolution to a chain of resolvers. 1
ChainEntityResolverTest class Drupal\Tests\serialization\Unit\EntityResolver core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php Tests Drupal\serialization\EntityResolver\ChainEntityResolver.
ChainRequestPolicy class Drupal\Core\PageCache core/lib/Drupal/Core/PageCache/ChainRequestPolicy.php Implements a compound request policy. 2 2
ChainRequestPolicyInterface interface Drupal\Core\PageCache core/lib/Drupal/Core/PageCache/ChainRequestPolicyInterface.php Defines the interface for compound request policies. 1
ChainRequestPolicyTest class Drupal\Tests\Core\PageCache core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php Tests Drupal\Core\PageCache\ChainRequestPolicy.
ChainResponsePolicy class Drupal\Core\ProxyClass\PageCache core/lib/Drupal/Core/ProxyClass/PageCache/ChainResponsePolicy.php Provides a proxy class for \Drupal\Core\PageCache\ChainResponsePolicy.
ChainResponsePolicy class Drupal\Core\PageCache core/lib/Drupal/Core/PageCache/ChainResponsePolicy.php Implements a compound response policy. 1 4
ChainResponsePolicyInterface interface Drupal\Core\PageCache core/lib/Drupal/Core/PageCache/ChainResponsePolicyInterface.php Defines the interface for compound request policies. 2
ChainResponsePolicyTest class Drupal\Tests\Core\PageCache core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php Tests Drupal\Core\PageCache\ChainResponsePolicy.
ChangedCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/ChangedCommand.php An AJAX command for marking HTML elements as changed. 2
ChangedFieldItemList class Drupal\Core\Field core/lib/Drupal/Core/Field/ChangedFieldItemList.php Defines an item list class for changed fields. 2
ChangedItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/ChangedItem.php Defines the 'changed' entity field type. 1 2
ChangedTestItem class Drupal\entity_test\Plugin\Field\FieldType core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ChangedTestItem.php Defines the 'changed_test' entity field type.
ChangeLogger final class Drupal\package_manager\EventSubscriber core/modules/package_manager/src/EventSubscriber/ChangeLogger.php Event subscriber to log changes that happen during the stage life cycle. 1
ChangeLoggerTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/ChangeLoggerTest.php Tests Change Logger.
ChangePromotedDefaultTest class Drupal\Tests\node\Functional\Update core/modules/node/tests/src/Functional/Update/ChangePromotedDefaultTest.php Tests creating base field overrides for the promote field on node types.
ChangeUserRoleBase abstract class Drupal\user\Plugin\Action core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php Provides a base class for operations to change a user's role. 2
Checkbox class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Checkbox.php Provides a form element for a single checkbox.
Checkboxes class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Checkboxes.php Provides a form element for a set of checkboxes. 3
CheckboxTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/CheckboxTest.php Tests the form API checkbox element.
CheckMarkupDeprecationTest class Drupal\Tests\filter\Kernel core/modules/filter/tests/src/Kernel/CheckMarkupDeprecationTest.php Tests deprecation of check_markup().
Checkpoint final class Drupal\Core\Config\Checkpoint core/lib/Drupal/Core/Config/Checkpoint/Checkpoint.php A value object to store information about a checkpoint. 6
CheckpointExistsException final class Drupal\Core\Config\Checkpoint core/lib/Drupal/Core/Config/Checkpoint/CheckpointExistsException.php Thrown when trying to add a checkpoint with an ID that already exists. 1
CheckpointListInterface interface Drupal\Core\Config\Checkpoint core/lib/Drupal/Core/Config/Checkpoint/CheckpointListInterface.php Maintains a list of checkpoints. 1
CheckpointStorage final class Drupal\Core\Config\Checkpoint core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php Provides a config storage that can make checkpoints. 1 2
CheckpointStorageInterface interface Drupal\Core\Config\Checkpoint core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorageInterface.php Provides an interface for checkpoint storages. 1 2
CheckpointStorageTest class Drupal\Tests\Core\Config\Checkpoint core/tests/Drupal/Tests/Core/Config/Checkpoint/CheckpointStorageTest.php Tests Drupal\Core\Config\Checkpoint\CheckpointStorage.
CheckpointStorageTest class Drupal\KernelTests\Core\Config\Storage\Checkpoint core/tests/Drupal/KernelTests/Core/Config/Storage/Checkpoint/CheckpointStorageTest.php Tests CheckpointStorage operations.
CheckProvider class Drupal\Core\Access core/lib/Drupal/Core/Access/CheckProvider.php Loads access checkers from the container. 1 2
CheckProviderInterface interface Drupal\Core\Access core/lib/Drupal/Core/Access/CheckProviderInterface.php Provides the available access checkers by service IDs. 1 2
CheckRequirementsTest class Drupal\Tests\migrate\Unit\Plugin\migrate\destination core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php Tests check requirements exception on DestinationBase.
Cherry class Drupal\plugin_test\Plugin\plugin_test\fruit core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/Cherry.php Plugin annotation @Plugin( id = "cherry", label = "Cherry", color = "red" )
ChildSandboxManager class Drupal\Tests\package_manager\Unit core/modules/package_manager/tests/src/Unit/SandboxManagerBaseTest.php Test class for testing the child stage.
ChildWithDeprecatedMethod class Drupal\drupal_debug_test_core core/tests/fixtures/TestTools/drupal_debug_classloader_test_classes.php Fixture: cross-module child with deprecated method.
ChildWithNativeReturnType class Drupal\drupal_debug_test_core core/tests/fixtures/TestTools/drupal_debug_classloader_test_classes.php Fixture: cross-module child with native return type.
ChildWithoutOverride class Drupal\drupal_debug_test_core core/tests/fixtures/TestTools/drupal_debug_classloader_test_classes.php Fixture: cross-module child that does not override the method.
ChildWithoutReturnType class Drupal\drupal_debug_test_core core/tests/fixtures/TestTools/drupal_debug_classloader_test_classes.php Fixture: cross-module child without native return type.
ChildWithReturnAnnotation class Drupal\drupal_debug_test_core core/tests/fixtures/TestTools/drupal_debug_classloader_test_classes.php Fixture: cross-module child with own
CHooks class Drupal\ccc_hook_order_test\Hook core/modules/system/tests/modules/HookOrder/ccc_hook_order_test/src/Hook/CHooks.php Provides hook implementations for testing the execution order of hooks. 3
ChooseBlockController class Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/ChooseBlockController.php Defines a controller to choose a new block.
ChooseSectionController class Drupal\layout_builder\Controller core/modules/layout_builder/src/Controller/ChooseSectionController.php Defines a controller to choose a new section.
CircularDependencyHooks class Drupal\hook_loader_test\Hook core/modules/system/tests/modules/HookLoader/hook_loader_test/src/Hook/CircularDependencyHooks.php Example to test that a hook service can depend on ModuleHandler. 1
CKEditor5 class Drupal\ckeditor5\Plugin\Editor core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php Defines a CKEditor 5-based text editor for Drupal. 26

Other projects


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