Data cache
BearFramework\App\CacheRepository {

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

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.
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.
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.