Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CacheItemPoolInterface.php

function CacheItemPoolInterface::hasItem

Confirms if the cache contains specified cache item.

Note: This method MAY avoid retrieving the cached value for performance reasons. This could result in a race condition with CacheItemInterface::get(). To avoid such situation use CacheItemInterface::isHit() instead.

Parameters

string $key: The key for which to check existence.

Return value

bool True if item exists in the cache, false otherwise.

Throws

InvalidArgumentException If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException MUST be thrown.

File

vendor/psr/cache/src/CacheItemPoolInterface.php, line 69

Class

CacheItemPoolInterface
CacheItemPoolInterface generates CacheItemInterface objects.

Namespace

Psr\Cache

Code

public function hasItem(string $key) : bool;
RSS feed
Powered by Drupal