Classes, traits, and interfaces - 8.9.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 1511

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
CacheTestController class Drupal\cache_test\Controller core/modules/system/tests/modules/cache_test/src/Controller/CacheTestController.php Controller routines for cache_test routes.
CacheWebTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php Tests pluggable caching for views via a web test.
CalculatedCacheContextInterface interface Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php Provides an interface for defining a calculated cache context service. 10 3
CallableClass class Drupal\Tests\Component\EventDispatcher core/tests/Drupal/Tests/Component/EventDispatcher/ContainerAwareEventDispatcherTest.php
Callback class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/Callback.php Passes the source value to a callback. 1
Callbacks class Drupal\ajax_forms_test core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php Simple object for testing methods as Ajax callbacks. 3
Callbacks class Drupal\form_test core/modules/system/tests/modules/form_test/src/Callbacks.php Simple class for testing methods as Form API callbacks. 1
CallbackTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/CallbackTest.php Tests the callback process plugin.
CancelUser class Drupal\user\Plugin\Action core/modules/user/src/Plugin/Action/CancelUser.php Cancels a user account.
CaseInsensitivePathTest class Drupal\FunctionalTests\Routing core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php Tests incoming path case insensitivity.
CaseSensitivityTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php Tests handling case sensitive collation.
CategorizingPluginManager class Drupal\Tests\Core\Plugin core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php Class that allows testing the trait.
CategorizingPluginManagerInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/CategorizingPluginManagerInterface.php Defines an interface for plugin managers that categorize plugin definitions. 6 6
CategorizingPluginManagerTrait trait Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php Provides a trait for the CategorizingPluginManagerInterface. 5
CategorizingPluginManagerTraitTest class Drupal\Tests\Core\Plugin core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php @coversDefaultClass \Drupal\Core\Plugin\CategorizingPluginManagerTrait @group Plugin
CategoryAutocompleteController class Drupal\block\Controller core/modules/block/src/Controller/CategoryAutocompleteController.php Returns autocomplete responses for block categories. 1
CategoryAutocompleteTest class Drupal\Tests\block\Unit core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php @coversDefaultClass \Drupal\block\Controller\CategoryAutocompleteController @group block
CckFieldBackwardsCompatibilityTest class Drupal\Tests\migrate_drupal\Kernel core/modules/migrate_drupal/tests/src/Kernel/CckFieldBackwardsCompatibilityTest.php @group migrate_drupal @group legacy
CckFieldPluginBase

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase instead.

abstract class Drupal\migrate_drupal\Plugin\migrate\cckfield core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php The base class for all field plugins. 8 8
CckFile

in drupal:8.3.0 and is removed from drupal:9.0.0. Use \Drupal\file\Plugin\migrate\process\d6\FieldFile instead.

class Drupal\file\Plugin\migrate\process\d6 core/modules/file/src/Plugin/migrate/process/d6/CckFile.php Plugin annotation @MigrateProcessPlugin( id = "d6_cck_file" ) 2
CckFileTest class Drupal\Tests\file\Unit\Plugin\migrate\process\d6 core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/CckFileTest.php @group file @group legacy
CckFileTest class Drupal\Tests\file\Kernel\Migrate\process\d6 core/modules/file/tests/src/Kernel/Migrate/process/d6/CckFileTest.php Cck file field migration.
CckLink

in drupal:8.3.0 and is removed from drupal:9.0.0. Use \Drupal\link\Plugin\migrate\process\FieldLink instead.

class Drupal\link\Plugin\migrate\process\d6 core/modules/link/src/Plugin/migrate/process/d6/CckLink.php Plugin annotation @MigrateProcessPlugin( id = "d6_cck_link" )
CckMigration

in drupal:8.3.0 and is removed from drupal:9.0.0. Use \Drupal\migrate_drupal\Plugin\migrate\FieldMigration instead.

class Drupal\migrate_drupal\Plugin\migrate core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php Migration plugin class for migrations dealing with CCK field values.
ChainBreadcrumbBuilderInterface interface Drupal\Core\Breadcrumb core/lib/Drupal/Core/Breadcrumb/ChainBreadcrumbBuilderInterface.php Defines an interface a chained service that builds the breadcrumb. 1
ChainedFastBackend class Drupal\Core\Cache core/lib/Drupal/Core/Cache/ChainedFastBackend.php Defines a backend with a fast and a consistent backend chain. 2
ChainedFastBackendFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php Defines the chained fast cache backend factory. 2
ChainedFastBackendTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php @coversDefaultClass \Drupal\Core\Cache\ChainedFastBackend @group Cache
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 @coversDefaultClass \Drupal\Core\Render\Placeholder\ChainedPlaceholderStrategy @group Render
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 a entity resolution to a chain of resolvers. 1
ChainEntityResolverTest class Drupal\Tests\serialization\Unit\EntityResolver core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php @coversDefaultClass \Drupal\serialization\EntityResolver\ChainEntityResolver @group serialization
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 @coversDefaultClass \Drupal\Core\PageCache\ChainRequestPolicy @group PageCache
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 @coversDefaultClass \Drupal\Core\PageCache\ChainResponsePolicy @group PageCache
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 a item list class for changed fields.
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.
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 form API checkbox handling of various combinations of #default_value and #return_value.
CheckProvider class Drupal\Core\Access core/lib/Drupal/Core/Access/CheckProvider.php Loads access checkers from the container. 1 2

Other projects


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