Sunnysideup\Ecommerce\Api\EcommerceCache
Provides a standard interface for caching product and group information.
Can be used in conjuction with the standard Silverstripe Partial caching
functionality.
usage:
```php
$myCachedData = EcommerceCache::inst()->retrieve($key);
EcommerceCache::inst()->save($key, $myUncachedData);
```
Synopsis
class EcommerceCache
implements
Flushable
{
- // members
- protected CacheInterface $cacheBackend;
- protected string $productCacheKey = '';
- // methods
- public static void inst()
- public void setCacheBackend()
- public CacheInterface getCacheBackend()
- public void hasCache()
- public void productCacheKey()
- public null|mixed retrieve()
- public void retrieveAsIdList()
- public void save()
- public void AllowCaching()
- public void clear()
- public static void flush()
- public void cacheKeyRefiner()
Hierarchy
Uses
- SilverStripe\Core\Injector\Injectable
Implements
- SilverStripe\Core\Flushable
Members
protected
- $cacheBackend — Psr\SimpleCache\CacheInterface
- $productCacheKey
Methods
public
- AllowCaching()
- cacheKeyRefiner() — Most importantly, adds Product Last Changed + Count!
- clear()
- flush()
- getCacheBackend() — Get the cache object to use when storing / retrieving stuff in the Silverstripe Cache.
- hasCache()
- inst()
- productCacheKey()
- retrieve() — Retrieve an object from the cache.
- retrieveAsIdList()
- save() — returns true when the data is saved...
- setCacheBackend() — Set the cache object to use when storing / retrieving partial cache blocks.