interface CachedDiscoveryInterface

Same name in other branches
  1. 9 core/lib/Drupal/Component/Plugin/Discovery/CachedDiscoveryInterface.php \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface
  2. 8.9.x core/lib/Drupal/Component/Plugin/Discovery/CachedDiscoveryInterface.php \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface
  3. 10 core/lib/Drupal/Component/Plugin/Discovery/CachedDiscoveryInterface.php \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface

Interface for discovery components holding a cache of plugin definitions.

Hierarchy

Expanded class hierarchy of CachedDiscoveryInterface

All classes that implement CachedDiscoveryInterface

6 files declare their use of CachedDiscoveryInterface
Block.php in core/modules/views/src/Plugin/views/display/Block.php
CachedDiscoveryClearer.php in core/lib/Drupal/Core/Plugin/CachedDiscoveryClearer.php
DefaultPluginManager.php in core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
EntityTypeManagerInterface.php in core/lib/Drupal/Core/Entity/EntityTypeManagerInterface.php
ExtraFieldBlockCacheTagInvalidator.php in core/modules/layout_builder/src/Cache/ExtraFieldBlockCacheTagInvalidator.php

... See full list

File

core/lib/Drupal/Component/Plugin/Discovery/CachedDiscoveryInterface.php, line 8

Namespace

Drupal\Component\Plugin\Discovery
View source
interface CachedDiscoveryInterface extends DiscoveryInterface {
    
    /**
     * Clears static and persistent plugin definition caches.
     *
     * Don't resort to calling \Drupal::cache()->delete() and friends to make
     * Drupal detect new or updated plugin definitions. Always use this method on
     * the appropriate plugin type's plugin manager!
     */
    public function clearCachedDefinitions();
    
    /**
     * Disable the use of caches.
     *
     * Can be used to ensure that uncached plugin definitions are returned,
     * without invalidating all cached information.
     *
     * This will also remove all local/static caches.
     *
     * @param bool $use_caches
     *   FALSE to not use any caches.
     */
    public function useCaches($use_caches = FALSE);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
CachedDiscoveryInterface::clearCachedDefinitions public function Clears static and persistent plugin definition caches. 2
CachedDiscoveryInterface::useCaches public function Disable the use of caches. 2
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 2
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 1
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists.

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