BearFramework\App\CacheRepository

Data cache
BearFramework\App\CacheRepository {

    
/* Methods */
    
public self addEventListener string $name , callable $listener )
    public 
self clear void )
    public 
self delete string $key )
    public 
self dispatchEvent string $name [, mixed $details ] )
    public 
bool exists string $key )
    public 
BearFramework\App\CacheItem|null get string $key )
    public 
mixed getValue string $key )
    public 
bool hasEventListeners string $name )
    public 
BearFramework\App\CacheItem make ( [ string|null $key [, string|null $value ]] )
    public 
self removeEventListener string $name , callable $listener )
    public 
self set BearFramework\App\CacheItem $item )
    public 
self setDriver BearFramework\App\ICacheDriver $driver )
    public 
self useAppDataDriver ( [ string $keyPrefix '.temp/cache/' ] )
    public 
self useNullDriver void )

}
Methods
public self addEventListener ( string $name , callable $listener )
Registers a new event listener.
public self clear ( void )
Deletes all values from the cache.
public self delete ( string $key )
Deletes an item from the cache.
public self dispatchEvent ( string $name [, mixed $details ] )
Calls the registered listeners (in order) for the event name specified.
public bool exists ( string $key )
Returns information whether a key exists in the cache.
public BearFramework\App\CacheItem|null get ( string $key )
Returns the cache item stored or null if not found.
public mixed getValue ( string $key )
Returns the value of the cache item specified.
public bool hasEventListeners ( string $name )
Returns TRUE if there are registered event listeners for the name specified, FALSE otherwise.
public BearFramework\App\CacheItem make ( [ string|null $key [, string|null $value ]] )
Constructs a new cache item and returns it.
public self removeEventListener ( string $name , callable $listener )
Removes a registered event listener.
public self set ( BearFramework\App\CacheItem $item )
Stores a cache item.
Sets a new cache driver.
public self useAppDataDriver ( [ string $keyPrefix = '.temp/cache/' ] )
Enables the app cache driver. The cached data will be stored in the app data repository.
public self useNullDriver ( void )
Enables the null cache driver. No data is stored and no errors are thrown.
Events
null clear
An event dispatched after the cache is cleared.
BearFramework\App\Cache\ItemChangeEvent itemChange
An event dispatched after a cache item is changed.
BearFramework\App\Cache\ItemDeleteEvent itemDelete
An event dispatched after a cache item is deleted.
BearFramework\App\Cache\ItemExistsEvent itemExists
An event dispatched after a cache item is checked for existence.
BearFramework\App\Cache\ItemGetEvent itemGet
An event dispatched after a cache item is requested.
BearFramework\App\Cache\ItemGetValueEvent itemGetValue
An event dispatched after the value of a cache item is requested.
BearFramework\App\Cache\ItemRequestEvent itemRequest
An event dispatched after a cache item is requested.
BearFramework\App\Cache\ItemSetEvent itemSet
An event dispatched after a cache item is added or updated.
Details
Location: ~/src/App/CacheRepository.php
The information on this page is created for version 1.1 of Bear Framework and may not be applicable for other versions of the framework.