Classes, traits, and interfaces in Drupal 9
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
|
Name |
Type | Namespace | Location | Description | Direct uses | Use statements | Strings |
|---|---|---|---|---|---|---|---|
| CacheableNormalizerInterface | interface |
Drupal\ |
core/ |
Defines the interface for normalizers producing cacheable normalizations. | 1 | 5 | |
| CacheableNotAcceptableHttpException | class |
Drupal\ |
core/ |
A cacheable NotAcceptableHttpException. | 1 | ||
| CacheableNotFoundHttpException | class |
Drupal\ |
core/ |
A cacheable NotFoundHttpException. | 3 | ||
| CacheableOmission | final class |
Drupal\ |
core/ |
Represents the cacheability associated with the omission of a value. | 3 | ||
| CacheablePreconditionFailedHttpException | class |
Drupal\ |
core/ |
A cacheable PreconditionFailedHttpException. | 1 | ||
| CacheablePreconditionRequiredHttpException | class |
Drupal\ |
core/ |
A cacheable PreconditionRequiredHttpException. | 1 | ||
| CacheableRedirectResponse | class |
Drupal\ |
core/ |
A RedirectResponse that contains and can expose cacheability metadata. | 2 | ||
| CacheableResourceResponse | class |
Drupal\ |
core/ |
Extends ResourceResponse with cacheability. | 6 | ||
| CacheableResponse | class |
Drupal\ |
core/ |
A response that contains and can expose cacheability metadata. | 1 | 11 | |
| CacheableResponseInterface | interface |
Drupal\ |
core/ |
Defines an interface for responses that can expose cacheability metadata. | 8 | 24 | |
| CacheableResponseTrait | trait |
Drupal\ |
core/ |
Provides an implementation of CacheableResponseInterface. | 6 | ||
| CacheableRouteProviderInterface | interface |
Drupal\ |
core/ |
Extends the router provider interface to provide caching support. | 1 | 2 | |
| CacheableSecuredRedirectResponse | abstract class |
Drupal\ |
core/ |
Provides a common base class for cacheable safe redirects. | 2 | ||
| CacheableServiceUnavailableHttpException | class |
Drupal\ |
core/ |
A cacheable ServiceUnavailableHttpException. | 1 | ||
| CacheableTestDomainObject | class |
Drupal\ |
core/ |
||||
| CacheableTestResponse | class |
Drupal\ |
core/ |
||||
| CacheableTooManyRequestsHttpException | class |
Drupal\ |
core/ |
A cacheable TooManyRequestsHttpException. | 1 | ||
| CacheableUnauthorizedHttpException | class |
Drupal\ |
core/ |
A cacheable UnauthorizedHttpException. | 2 | ||
| CacheableUnprocessableEntityHttpException | class |
Drupal\ |
core/ |
A cacheable UnprocessableEntityHttpException. | 1 | ||
| CacheableUnsupportedMediaTypeHttpException | class |
Drupal\ |
core/ |
A cacheable UnsupportedMediaTypeHttpException. | 1 | ||
| CacheBackendInterface | interface |
Drupal\ |
core/ |
Defines an interface for cache implementations. | 8 | 114 | 25 |
| CacheCollector | abstract class |
Drupal\ |
core/ |
Default implementation for CacheCollectorInterface. | 7 | 7 | |
| CacheCollectorHelper | class |
Drupal\ |
core/ |
Helper class to test the cache collector. | 1 | ||
| CacheCollectorInterface | interface |
Drupal\ |
core/ |
Provides a caching wrapper to be used in place of large structures. | 2 | 2 | |
| CacheCollectorTest | class |
Drupal\ |
core/ |
Tests DatabaseBackend cache tag implementation. | |||
| CacheContextInterface | interface |
Drupal\ |
core/ |
Provides an interface for defining a cache context service. | 22 | 7 | |
| CacheContextOptimizationTest | class |
Drupal\ |
core/ |
Tests the cache context optimization. | |||
| CacheContextsManager | class |
Drupal\ |
core/ |
Converts cache context tokens into cache keys. | 27 | 2 | |
| CacheContextsManagerTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Cache\Context\CacheContextsManager @group Cache | |||
| CacheContextsPass | class |
Drupal\ |
core/ |
Adds cache_contexts parameter to the container. | 1 | ||
| CachedDataUITest | class |
Drupal\ |
core/ |
Tests the shared tempstore cache in the UI. | |||
| CachedDiscoveryClearer | class |
Drupal\ |
core/ |
Defines a class which is capable of clearing the cache on plugin managers. | 2 | ||
| CachedDiscoveryClearer | class |
Drupal\ |
core/ |
Provides a proxy class for \Drupal\Core\Plugin\CachedDiscoveryClearer. | |||
| CachedDiscoveryClearerInterface | interface |
Drupal\ |
core/ |
Provides a way to clear static caches of all plugin managers. | 2 | ||
| CachedDiscoveryInterface | interface |
Drupal\ |
core/ |
Interface for discovery components holding a cache of plugin definitions. | 3 | 6 | |
| CacheDecoratorInterface | interface |
Drupal\ |
core/ |
Defines an interface for cache decorator implementations. | |||
| CachedStorage | class |
Drupal\ |
core/ |
Defines the cached storage. | 2 | 2 | |
| CachedStorageTest | class |
Drupal\ |
core/ |
Tests the interaction of cache and file storage in CachedStorage. | |||
| CachedStorageTest | class |
Drupal\ |
core/ |
Tests CachedStorage operations. | |||
| CacheFactory | class |
Drupal\ |
core/ |
1 | 2 | ||
| CacheFactoryInterface | interface |
Drupal\ |
core/ |
An interface defining cache factory classes. | 9 | 3 | |
| CacheFactoryTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Cache\CacheFactory @group Cache | |||
| CachePluginBase | abstract class |
Drupal\ |
core/ |
The base plugin to handle caching. | 3 | 7 | |
| CacheRouterRebuildSubscriber | class |
Drupal\ |
core/ |
Clear cache tags when the router is rebuilt. | 2 | ||
| CacheTagsChecksumInterface | interface |
Drupal\ |
core/ |
Provides checksums for cache tag invalidations. | 1 | 1 | |
| CacheTagsChecksumTrait | trait |
Drupal\ |
core/ |
A trait for cache tag checksum implementations. | |||
| CacheTagsInvalidator | class |
Drupal\ |
core/ |
Passes cache tag events to classes that wish to respond to them. | 1 | 2 | |
| CacheTagsInvalidatorInterface | interface |
Drupal\ |
core/ |
Defines required methods for classes wanting to handle cache tag changes. | 6 | 16 | |
| CacheTagsInvalidatorTest | class |
Drupal\ |
core/ |
@coversDefaultClass \Drupal\Core\Cache\CacheTagsInvalidator @group Cache | |||
| CacheTagTest | class |
Drupal\ |
core/ |
Tests tag cache plugin. |