Classes, traits, and interfaces - 9.5.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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
CacheContextsPass class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php Adds cache_contexts parameter to the container. 1
CachedDataUITest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/CachedDataUITest.php Tests the shared tempstore cache in the UI.
CachedDiscoveryClearer class Drupal\Core\ProxyClass\Plugin core/lib/Drupal/Core/ProxyClass/Plugin/CachedDiscoveryClearer.php Provides a proxy class for \Drupal\Core\Plugin\CachedDiscoveryClearer.
CachedDiscoveryClearer class Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/CachedDiscoveryClearer.php Defines a class which is capable of clearing the cache on plugin managers. 2
CachedDiscoveryClearerInterface interface Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/CachedDiscoveryClearerInterface.php Provides a way to clear static caches of all plugin managers. 2
CachedDiscoveryInterface interface Drupal\Component\Plugin\Discovery core/lib/Drupal/Component/Plugin/Discovery/CachedDiscoveryInterface.php Interface for discovery components holding a cache of plugin definitions. 3 6
CacheDecoratorInterface interface Drupal\Core\CacheDecorator core/lib/Drupal/Core/CacheDecorator/CacheDecoratorInterface.php Defines an interface for cache decorator implementations.
CachedStorage class Drupal\Core\Config core/lib/Drupal/Core/Config/CachedStorage.php Defines the cached storage. 2 2
CachedStorageTest class Drupal\Tests\Core\Config core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php Tests the interaction of cache and file storage in CachedStorage.
CachedStorageTest class Drupal\KernelTests\Core\Config\Storage core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php Tests CachedStorage operations.
CacheFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/CacheFactory.php 1 2
CacheFactoryInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/CacheFactoryInterface.php An interface defining cache factory classes. 9 3
CacheFactoryTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php @coversDefaultClass \Drupal\Core\Cache\CacheFactory @group Cache
CachePluginBase abstract class Drupal\views\Plugin\views\cache core/modules/views/src/Plugin/views/cache/CachePluginBase.php The base plugin to handle caching. 3 8
CacheRouterRebuildSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/CacheRouterRebuildSubscriber.php Clear cache tags when the router is rebuilt. 2
CacheTagsChecksumInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/CacheTagsChecksumInterface.php Provides checksums for cache tag invalidations. 1 1
CacheTagsChecksumTrait trait Drupal\Core\Cache core/lib/Drupal/Core/Cache/CacheTagsChecksumTrait.php A trait for cache tag checksum implementations.
CacheTagsInvalidator class Drupal\Core\Cache core/lib/Drupal/Core/Cache/CacheTagsInvalidator.php Passes cache tag events to classes that wish to respond to them. 1 2
CacheTagsInvalidatorInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/CacheTagsInvalidatorInterface.php Defines required methods for classes wanting to handle cache tag changes. 6 18
CacheTagsInvalidatorTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php @coversDefaultClass \Drupal\Core\Cache\CacheTagsInvalidator @group Cache
CacheTagTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php Tests tag cache plugin.
CacheTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/CacheTest.php Tests pluggable caching for views.
CacheTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/CacheTest.php @coversDefaultClass \Drupal\Core\Cache\Cache @group Cache
CacheTestBase abstract class Drupal\Tests\system\Functional\Cache core/modules/system/tests/src/Functional/Cache/CacheTestBase.php Provides helper methods for cache tests. 1
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
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\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.
ChainedFastBackendTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php @coversDefaultClass \Drupal\Core\Cache\ChainedFastBackend @group Cache
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 an entity resolution to a chain of resolvers. 1

Other projects


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