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\CacheCode
public function hasItem(string $key) : bool;