Drupal 8  8.0.2
CacheableDependencyInterface Interface Reference
Inheritance diagram for CacheableDependencyInterface:

Public Member Functions

 getCacheContexts ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 

Detailed Description

Defines an interface for objects which may be used by other cached objects.

All cacheability metadata exposed in this interface is bubbled to parent objects when they are cached: if a child object needs to be varied by certain cache contexts, invalidated by certain cache tags, expire after a certain maximum age, then so should any parent object.

Member Function Documentation

getCacheContexts ( )

The cache contexts associated with this object.

These identify a specific variation/representation of the object.

Cache contexts are tokens: placeholders that are converted to cache keys by the service. The replacement value depends on the request context (the current URL, language, and so on). They're converted before storing an object in cache.

Returns
string[] An array of cache context tokens, used to generate a cache ID.
See Also
::convertTokensToKeys()

Implemented in FilterPluginBase, ArgumentPluginBase, ViewUI, Field, Entity, Table, SqlBase, TaxonomyIndexTid, QueryPluginBase, ConfigBase, SortPluginBase, Tid, SystemMenuBlock, MenuLinkBase, BookNavigationBlock, AccessResult, Serializer, RequestPath, LocalTaskDefault, Role, Context, Permission, Raw, CurrentThemeCondition, BulkForm, HelpBlock, User, QueryParameter, LocalActionsBlock, UserRole, ForumBlockBase, LoginLogoutMenuLink, Node, TranslationLanguageRenderer, MenuLinkMock, RendererBase, EntityFieldRenderer, DynamicMenuLinkMock, Fixed, InaccessibleMenuLink, Access, Current, Random, CurrentUser, CacheableMetadata, TestCacheBlock, Status, ViewsTestCacheContextFilter, TestCacheableDependency, ViewsExposedFilterBlock, and CacheableTestDomainObject.

Referenced by EntityViewBuilder\getBuildDefaults().

Here is the caller graph for this function:

getCacheMaxAge ( )

The maximum age for which this object may be cached.

Returns
int The maximum time in seconds that this object may be cached.

Implemented in Sql, FilterPluginBase, ViewUI, ArgumentPluginBase, Field, Entity, Table, SqlBase, ExposedFormPluginBase, QueryPluginBase, ConfigBase, SortPluginBase, Tid, AccessResult, BookNavigationBlock, MenuLinkBase, LocalTaskDefault, Context, Serializer, Role, Permission, Raw, LanguageBlock, BulkForm, User, HistoryUserTimestamp, MenuLinkMock, QueryParameter, TestAccessBlock, Node, RedirectFormBlock, InaccessibleMenuLink, RendererBase, CacheableMetadata, Fixed, AttachedRenderingBlock, TestCacheBlock, SystemMessagesBlock, TestCacheableDependency, Random, CurrentUser, and CacheableTestDomainObject.

Referenced by EntityViewBuilder\getBuildDefaults().

Here is the caller graph for this function:

getCacheTags ( )

The cache tags associated with this object.

When this object is modified, these cache tags will be invalidated.

Returns
string[] A set of cache tags.

Implemented in Sql, FilterPluginBase, ArgumentPluginBase, ViewUI, Field, Entity, Table, SqlBase, ExposedFormPluginBase, QueryPluginBase, ConfigBase, SortPluginBase, MenuLinkBase, AccessResult, AggregatorFeedBlock, SystemBrandingBlock, SystemMenuBlock, Serializer, Role, Context, Permission, LocalTaskDefault, BulkForm, ForumBlockBase, MenuLinkMock, RendererBase, InaccessibleMenuLink, ThemeSettings, Random, TestCacheableDependency, TestTasksSettingsSub1, CacheableTestDomainObject, and CacheableMetadata.

Referenced by EntityViewBuilder\getBuildDefaults(), and Field\getCacheTags().

Here is the caller graph for this function:


The documentation for this interface was generated from the following file: