You are here

class MetatagViewsCachePluginManager in Metatag 8

Hierarchy

Expanded class hierarchy of MetatagViewsCachePluginManager

1 string reference to 'MetatagViewsCachePluginManager'
metatag_views.services.yml in metatag_views/metatag_views.services.yml
metatag_views/metatag_views.services.yml
1 service uses MetatagViewsCachePluginManager
metatag_views.plugin.manager.views.cache in metatag_views/metatag_views.services.yml
Drupal\metatag_views\MetatagViewsCachePluginManager

File

metatag_views/src/MetatagViewsCachePluginManager.php, line 11

Namespace

Drupal\metatag_views
View source
class MetatagViewsCachePluginManager implements PluginManagerInterface, CachedDiscoveryInterface, CacheableDependencyInterface {

  /**
   * @var \Drupal\views\Plugin\ViewsPluginManager
   */
  protected $viewsPluginManager;

  /**
   * MetatagViewsCachePluginManager constructor.
   *
   * @param \Drupal\views\Plugin\ViewsPluginManager $views_plugin_manager
   */
  public function __construct(ViewsPluginManager $views_plugin_manager) {
    $this->viewsPluginManager = $views_plugin_manager;
  }

  /**
   * @param \Drupal\views\Plugin\views\cache\CachePluginBase $plugin
   *
   * @return \Drupal\metatag_views\MetatagViewsCacheWrapper
   */
  protected function wrap(CachePluginBase $plugin) {
    return new MetatagViewsCacheWrapper($plugin);
  }

  /**
   * {@inheritdoc}
   */
  public function createInstance($plugin_id, array $configuration = []) {
    return $this
      ->wrap($this->viewsPluginManager
      ->createInstance($plugin_id, $configuration));
  }

  /**
   * {@inheritdoc}
   */
  public function getInstance(array $options) {
    return $this
      ->wrap($this->viewsPluginManager
      ->getInstance($options));
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheContexts() {
    return $this->viewsPluginManager
      ->getCacheContexts();
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheTags() {
    return $this->viewsPluginManager
      ->getCacheTags();
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheMaxAge() {
    return $this->viewsPluginManager
      ->getCacheMaxAge();
  }

  /**
   * {@inheritdoc}
   */
  public function clearCachedDefinitions() {
    $this->viewsPluginManager
      ->clearCachedDefinitions();
  }

  /**
   * {@inheritdoc}
   */
  public function useCaches($use_caches = FALSE) {
    $this->viewsPluginManager
      ->useCaches($use_caches);
  }

  /**
   * {@inheritdoc}
   */
  public function getDefinition($plugin_id, $exception_on_invalid = TRUE) {
    return $this->viewsPluginManager
      ->getDefinition($plugin_id, $exception_on_invalid);
  }

  /**
   * {@inheritdoc}
   */
  public function getDefinitions() {
    return $this->viewsPluginManager
      ->getDefinitions();
  }

  /**
   * {@inheritdoc}
   */
  public function hasDefinition($plugin_id) {
    return $this->viewsPluginManager
      ->hasDefinition($plugin_id);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MetatagViewsCachePluginManager::$viewsPluginManager protected property
MetatagViewsCachePluginManager::clearCachedDefinitions public function Clears static and persistent plugin definition caches. Overrides CachedDiscoveryInterface::clearCachedDefinitions
MetatagViewsCachePluginManager::createInstance public function Creates a pre-configured instance of a plugin. Overrides FactoryInterface::createInstance
MetatagViewsCachePluginManager::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyInterface::getCacheContexts
MetatagViewsCachePluginManager::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyInterface::getCacheMaxAge
MetatagViewsCachePluginManager::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyInterface::getCacheTags
MetatagViewsCachePluginManager::getDefinition public function Gets a specific plugin definition. Overrides DiscoveryInterface::getDefinition
MetatagViewsCachePluginManager::getDefinitions public function Gets the definition of all plugins for this type. Overrides DiscoveryInterface::getDefinitions
MetatagViewsCachePluginManager::getInstance public function Gets a preconfigured instance of a plugin. Overrides MapperInterface::getInstance
MetatagViewsCachePluginManager::hasDefinition public function Indicates if a specific plugin definition exists. Overrides DiscoveryInterface::hasDefinition
MetatagViewsCachePluginManager::useCaches public function Disable the use of caches. Overrides CachedDiscoveryInterface::useCaches
MetatagViewsCachePluginManager::wrap protected function
MetatagViewsCachePluginManager::__construct public function MetatagViewsCachePluginManager constructor.