Interface Guzzle\Cache\CacheAdapterInterface

Implemented byGuzzle\Cache\AbstractCacheAdapter, Guzzle\Cache\ClosureCacheAdapter, Guzzle\Cache\DoctrineCacheAdapter, Guzzle\Cache\NullCacheAdapter, Guzzle\Cache\Zf1CacheAdapter, Guzzle\Cache\Zf2CacheAdapter

Interface for cache adapters.

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

Public Methods

Hide inherited methods

MethodDescriptionDefined By
contains() Test if an entry exists in the cache. Guzzle\Cache\CacheAdapterInterface
delete() Deletes a cache entry. Guzzle\Cache\CacheAdapterInterface
fetch() Fetches an entry from the cache. Guzzle\Cache\CacheAdapterInterface
save() Puts data into the cache. Guzzle\Cache\CacheAdapterInterface

Method Details

contains() public abstract method

Test if an entry exists in the cache.

public abstract bool contains ( $id, array $options null )
$id string

Cache id The cache id of the entry to check for.

$options array

Array of cache adapter options

return bool

Returns TRUE if a cache entry exists for the given cache id, FALSE otherwise.

delete() public abstract method

Deletes a cache entry.

public abstract bool delete ( $id, array $options null )
$id string

Cache id

$options array

Array of cache adapter options

return bool

TRUE on success, FALSE on failure

fetch() public abstract method

Fetches an entry from the cache.

public abstract string fetch ( $id, array $options null )
$id string

Cache id The id of the cache entry to fetch.

$options array

Array of cache adapter options

return string

The cached data or FALSE, if no cache entry exists for the given id.

save() public abstract method

Puts data into the cache.

public abstract bool save ( $id, $data, $lifeTime false, array $options null )
$id string

The cache id

$data string

The cache entry/data

$lifeTime int|bool

The lifetime. If != false, sets a specific lifetime for this cache entry

$options array

Array of cache adapter options

return bool

TRUE if the entry was successfully stored in the cache, FALSE otherwise.