PlaceholderInterface

Interface for a query that accepts placeholders. Hierarchy interface \Drupal\Core\Database\Query\PlaceholderInterface File core/lib/Drupal/Core/Database/Query/PlaceholderInterface.php, line 8 Namespace Drupal\Core\Database\Query Members Name Modifiers Type Description PlaceholderInterface::nextPlaceholder public function Returns the next placeholder ID for the query. PlaceholderInterface::uniqueIdentifier public function Returns a unique identifier for this objec

PlaceholderingRenderCache::__construct

public PlaceholderingRenderCache::__construct(RequestStack $request_stack, CacheFactoryInterface $cache_factory, CacheContextsManager $cache_contexts_manager, PlaceholderGeneratorInterface $placeholder_generator) Constructs a new PlaceholderingRenderCache object. Parameters \Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack. \Drupal\Core\Cache\CacheFactoryInterface $cache_factory: The cache factory. \Drupal\Core\Cache\Context\CacheContextsManager $cache_contexts_m

PlaceholderingRenderCache::set

public PlaceholderingRenderCache::set(array &$elements, array $pre_bubbling_elements) Caches the rendered output of a renderable array. May be called by an implementation of \Drupal\Core\Render\RendererInterface while rendering, if the #cache property is set. Parameters array $elements: A renderable array. array $pre_bubbling_elements: A renderable array corresponding to the state (in particular, the cacheability metadata) of $elements prior to the beginning of its rendering process, and t

PlaceholderingRenderCache::getFromPlaceholderResultsCache

protected PlaceholderingRenderCache::getFromPlaceholderResultsCache(array $elements) Retrieves an auto-placeholdered renderable array from the static cache. Parameters array $elements: A renderable array. Return value array|false A renderable array, with the original element and all its children pre- rendered, or FALSE if no cached copy of the element is available. File core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php, line 179 Class PlaceholderingRenderCache Adds automatic plac

PlaceholderingRenderCache::get

public PlaceholderingRenderCache::get(array $elements) Gets the cached, pre-rendered element of a renderable element from cache. Parameters array $elements: A renderable array. Return value array|false A renderable array, with the original element and all its children pre- rendered, or FALSE if no cached copy of the element is available. Overrides RenderCache::get See also \Drupal\Core\Render\RendererInterface::render() ::set() File core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php,

PlaceholderingRenderCache::createPlaceholderAndRemember

protected PlaceholderingRenderCache::createPlaceholderAndRemember(array $rendered_elements, array $pre_bubbling_elements) Create a placeholder for a renderable array and remember in a static cache. Parameters array $rendered_elements: A fully rendered renderable array. array $pre_bubbling_elements: A renderable array corresponding to the state (in particular, the cacheability metadata) of $rendered_elements prior to the beginning of its rendering process, and therefore before any bubbling of c

PlaceholderingRenderCache::$placeholderResultsCache

Stores rendered results for automatically placeholdered elements. This allows us to avoid talking to the cache twice per auto-placeholdered element, or in case of an uncacheable element, to render it twice. Scenario A. The double cache read would happen because: 1. when rendering, cache read, but auto-placeholdered 2. when rendering placeholders, again cache read Scenario B. The cache write plus read would happen because: 1. when rendering, cache write, but auto-placeholdered 2. when rendering

PlaceholderingRenderCache::$placeholderGenerator

The placeholder generator. Type: \Drupal\Core\Render\PlaceholderGeneratorInterface File core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php, line 47 Class PlaceholderingRenderCache Adds automatic placeholdering to the RenderCache. Namespace Drupal\Core\Render Code protected $placeholderGenerator;

PlaceholderingRenderCache

Adds automatic placeholdering to the RenderCache. This automatic placeholdering is performed to ensure the containing elements and overarching response are as cacheable as possible. Elements whose subtree bubble either max-age=0 or high-cardinality cache contexts (such as 'user' and 'session') are considered poorly cacheable. Automatic placeholdering is performed only on elements whose subtree was generated using a #lazy_builder callback and whose bubbled cacheability meets the auto-placeholder

PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder

public PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder(array $element) Whether the given render array should be automatically placeholdered. The render array should be placeholdered if its cacheability either has a cache context with too high cardinality, a cache tag with a too high invalidation rate, or a max-age that is too low. Either of these would make caching ineffective, and thus we choose to placeholder instead. Parameters array $element: The render array whose cacheabili