Open Journal Systems  3.3.0
Guzzle\Cache\CacheAdapterInterface Interface Reference
Inheritance diagram for Guzzle\Cache\CacheAdapterInterface:
Guzzle\Cache\AbstractCacheAdapter Guzzle\Cache\ClosureCacheAdapter Guzzle\Cache\DoctrineCacheAdapter Guzzle\Cache\NullCacheAdapter Guzzle\Cache\Zf1CacheAdapter Guzzle\Cache\Zf2CacheAdapter

Public Member Functions

 contains ($id, array $options=null)
 
 delete ($id, array $options=null)
 
 fetch ($id, array $options=null)
 
 save ($id, $data, $lifeTime=false, array $options=null)
 

Detailed Description

Interface for cache adapters.

Cache adapters allow Guzzle to utilize various frameworks for caching HTTP responses.

Inspired by Doctrine 2

Definition at line 12 of file CacheAdapterInterface.php.

Member Function Documentation

◆ contains()

Guzzle\Cache\CacheAdapterInterface::contains (   $id,
array  $options = null 
)

Test if an entry exists in the cache.

Parameters
string$idcache id The cache id of the entry to check for.
array$optionsArray of cache adapter options
Returns
bool Returns TRUE if a cache entry exists for the given cache id, FALSE otherwise.

Implemented in Guzzle\Cache\ClosureCacheAdapter, Guzzle\Cache\Zf1CacheAdapter, Guzzle\Cache\DoctrineCacheAdapter, Guzzle\Cache\Zf2CacheAdapter, and Guzzle\Cache\NullCacheAdapter.

◆ delete()

Guzzle\Cache\CacheAdapterInterface::delete (   $id,
array  $options = null 
)

Deletes a cache entry.

Parameters
string$idcache id
array$optionsArray of cache adapter options
Returns
bool TRUE on success, FALSE on failure

Implemented in Guzzle\Cache\ClosureCacheAdapter, Guzzle\Cache\Zf1CacheAdapter, Guzzle\Cache\DoctrineCacheAdapter, Guzzle\Cache\Zf2CacheAdapter, and Guzzle\Cache\NullCacheAdapter.

◆ fetch()

Guzzle\Cache\CacheAdapterInterface::fetch (   $id,
array  $options = null 
)

Fetches an entry from the cache.

Parameters
string$idcache id The id of the cache entry to fetch.
array$optionsArray of cache adapter options
Returns
string The cached data or FALSE, if no cache entry exists for the given id.

Implemented in Guzzle\Cache\ClosureCacheAdapter, Guzzle\Cache\Zf1CacheAdapter, Guzzle\Cache\DoctrineCacheAdapter, Guzzle\Cache\Zf2CacheAdapter, and Guzzle\Cache\NullCacheAdapter.

◆ save()

Guzzle\Cache\CacheAdapterInterface::save (   $id,
  $data,
  $lifeTime = false,
array  $options = null 
)

Puts data into the cache.

Parameters
string$idThe cache id
string$dataThe cache entry/data
int | bool$lifeTimeThe lifetime. If != false, sets a specific lifetime for this cache entry
array$optionsArray of cache adapter options
Returns
bool TRUE if the entry was successfully stored in the cache, FALSE otherwise.

Implemented in Guzzle\Cache\ClosureCacheAdapter, Guzzle\Cache\Zf1CacheAdapter, Guzzle\Cache\DoctrineCacheAdapter, Guzzle\Cache\Zf2CacheAdapter, and Guzzle\Cache\NullCacheAdapter.


The documentation for this interface was generated from the following file: