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 Locationsort descending Description Direct uses Use statements Strings
ContextCacheKeys class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/ContextCacheKeys.php A value object to store generated cache keys with its cacheability metadata. 1
CookiesCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/CookiesCacheContext.php Defines the CookiesCacheContext service, for "per cookie" caching. 1 2
HeadersCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/HeadersCacheContext.php Defines the HeadersCacheContext service, for "per header" caching. 1 2
IpCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/IpCacheContext.php Defines the IpCacheContext service, for "per IP address" caching. 2
IsFrontPathCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/IsFrontPathCacheContext.php Defines a cache context for whether the URL is the front page of the site. 1 2
IsSuperUserCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/IsSuperUserCacheContext.php Defines the IsSuperUserCacheContext service, for "super user or not" caching. 2
LanguagesCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/LanguagesCacheContext.php Defines the LanguagesCacheContext service, for "per language" caching. 2
PagersCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/PagersCacheContext.php Defines a cache context for "per page in a pager" caching. 2
PathCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/PathCacheContext.php Defines the PathCacheContext service, for "per URL path" caching. 2
PathParentCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/PathParentCacheContext.php Defines a cache context service for path parents. 1 2
ProtocolVersionCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/ProtocolVersionCacheContext.php Defines the ProtocolVersionCacheContext service, for "per protocol" caching. 1 2
QueryArgsCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/QueryArgsCacheContext.php Defines the QueryArgsCacheContext service, for "per query args" caching. 1 2
RequestFormatCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/RequestFormatCacheContext.php Defines the RequestFormatCacheContext service, for "per format" caching. 2
RequestStackCacheContextBase abstract class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php Defines a base class for cache contexts depending only on the request stack. 11
RouteCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/RouteCacheContext.php Defines the RouteCacheContext service, for "per route" caching. 1 2
RouteNameCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/RouteNameCacheContext.php Defines the RouteCacheContext service, for "per route name" caching. 1 1 2
SessionCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/SessionCacheContext.php Defines the SessionCacheContext service, for "per session" caching. 1 2
SessionExistsCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/SessionExistsCacheContext.php Defines the SessionExistsCacheContext service, for "session or not" caching. 2
SiteCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/SiteCacheContext.php Defines the SiteCacheContext service, for "per site" caching. 2
ThemeCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/ThemeCacheContext.php Defines the ThemeCacheContext service, for "per theme" caching. 2
TimeZoneCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php Defines the TimeZoneCacheContext service, for "per time zone" caching. 2
UrlCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/UrlCacheContext.php Defines the UrlCacheContext service, for "per page" caching. 2
UserCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/UserCacheContext.php Defines the UserCacheContext service, for "per user" caching. 2
UserCacheContextBase abstract class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/UserCacheContextBase.php Base class for user-based cache contexts. 5 1
UserRolesCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/UserRolesCacheContext.php Defines the UserRolesCacheContext service, for "per role" caching. 1 2
DatabaseCacheTagsChecksum class Drupal\Core\Cache core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php Cache tags invalidations checksum implementation that uses the database. 2
ListCacheBinsPass class Drupal\Core\Cache core/lib/Drupal/Core/Cache/ListCacheBinsPass.php Adds cache_bins parameter to the container. 1
MemoryCache class Drupal\Core\Cache\MemoryCache core/lib/Drupal/Core/Cache/MemoryCache/MemoryCache.php Defines a memory cache implementation. 3 4
MemoryCacheInterface interface Drupal\Core\Cache\MemoryCache core/lib/Drupal/Core/Cache/MemoryCache/MemoryCacheInterface.php Defines an interface for memory cache implementations. 1 10 4
MemoryCounterBackend class Drupal\Core\Cache core/lib/Drupal/Core/Cache/MemoryCounterBackend.php Defines a memory cache implementation that counts set and get calls. 1
NullBackend class Drupal\Core\Cache core/lib/Drupal/Core/Cache/NullBackend.php Defines a stub cache implementation. 1 13
NullBackendFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/NullBackendFactory.php 1 4
RefinableCacheableDependencyInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/RefinableCacheableDependencyInterface.php Allows to add cacheability metadata to an object for the current runtime. 8 18
RefinableCacheableDependencyTrait trait Drupal\Core\Cache core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php Trait for \Drupal\Core\Cache\RefinableCacheableDependencyInterface. 7
UncacheableDependencyTrait trait Drupal\Core\Cache core/lib/Drupal/Core/Cache/UncacheableDependencyTrait.php Trait to implement CacheableDependencyInterface for uncacheable objects. 2
UnchangingCacheableDependencyTrait trait Drupal\Core\Cache core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php Trait to implement CacheableDependencyInterface for unchanging objects. 4
UseCacheBackendTrait trait Drupal\Core\Cache core/lib/Drupal/Core/Cache/UseCacheBackendTrait.php Provides methods to use a cache backend while respecting a 'use caches' flag. 2
VariationCacheFactoryInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/VariationCacheFactoryInterface.php An interface defining variation cache factory classes.
VariationCacheInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/VariationCacheInterface.php Defines an interface for variation cache implementations. 3 7
CacheDecoratorInterface Deprecated interface Drupal\Core\CacheDecorator core/lib/Drupal/Core/CacheDecorator/CacheDecoratorInterface.php Defines an interface for cache decorator implementations.
DbCommandBase class Drupal\Core\Command core/lib/Drupal/Core/Command/DbCommandBase.php Base command that abstracts handling of database connection arguments. 3 1
DbDumpApplication class Drupal\Core\Command core/lib/Drupal/Core/Command/DbDumpApplication.php Provides a command to dump a database generation script. 2
DbDumpCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/DbDumpCommand.php Provides a command to dump the current database to a script. 1
DbImportCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/DbImportCommand.php Provides a command to import the current database from a script. 1
DbToolsApplication class Drupal\Core\Command core/lib/Drupal/Core/Command/DbToolsApplication.php Provides a command to import a database generation script. 2
GenerateProxyClassApplication class Drupal\Core\Command core/lib/Drupal/Core/Command/GenerateProxyClassApplication.php Provides a console command to generate proxy classes. 1
GenerateProxyClassCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php Provides a console command to generate proxy classes.
InstallCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/InstallCommand.php Installs a Drupal site for local testing/development.
QuickStartCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/QuickStartCommand.php Installs a Drupal site and starts a webserver for local testing/development.
ServerCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/ServerCommand.php Runs the PHP webserver for a Drupal site for local testing/development.

Pages

Other projects