PHP Class Newscoop\Services\CacheService

Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Свойство Type Description
$cacheDriver Doctrine\Common\Cache\CacheProvider Instance of cache driver
$systemPreferences Newscoop\NewscoopBundle\Services\SystemPreferencesService

Méthodes publiques

Méthode Description
__construct ( SystemPreferencesService $systemPreferences ) Initialize cache driver (based on system preferences settings, default is array)
clearNamespace ( $namespace )
contains ( string | array $id ) : boolean Check if cache have provided key
delete ( string | array $id ) : boolean Delete key from cache
fetch ( string | array $id ) : mixed Fetch data from cache
getAvailableCacheEngines ( ) : array Get array of avaiable cache drivers (based on system configurations)
getCacheDriver ( ) : CacheProvider Get cache driver instance
getCacheKey ( $id, $namespace = null )
getNamespace ( $namespace )
save ( string | array $id, mixed $data, integer $lifeTime = 1400 ) : boolean Save new value in cache

Method Details

__construct() public méthode

Initialize cache driver (based on system preferences settings, default is array)
public __construct ( SystemPreferencesService $systemPreferences )
$systemPreferences Newscoop\NewscoopBundle\Services\SystemPreferencesService

clearNamespace() public méthode

public clearNamespace ( $namespace )

contains() public méthode

Check if cache have provided key
public contains ( string | array $id ) : boolean
$id string | array
Résultat boolean

delete() public méthode

Delete key from cache
public delete ( string | array $id ) : boolean
$id string | array
Résultat boolean

fetch() public méthode

Fetch data from cache
public fetch ( string | array $id ) : mixed
$id string | array
Résultat mixed

getAvailableCacheEngines() public méthode

Get array of avaiable cache drivers (based on system configurations)
public getAvailableCacheEngines ( ) : array
Résultat array

getCacheDriver() public méthode

Get cache driver instance
public getCacheDriver ( ) : CacheProvider
Résultat Doctrine\Common\Cache\CacheProvider

getCacheKey() public méthode

public getCacheKey ( $id, $namespace = null )

getNamespace() public méthode

public getNamespace ( $namespace )

save() public méthode

Save new value in cache
public save ( string | array $id, mixed $data, integer $lifeTime = 1400 ) : boolean
$id string | array
$data mixed
$lifeTime integer
Résultat boolean

Property Details

$cacheDriver protected_oe property

Instance of cache driver
protected CacheProvider,Doctrine\Common\Cache $cacheDriver
Résultat Doctrine\Common\Cache\CacheProvider

$systemPreferences protected_oe property

protected SystemPreferencesService,Newscoop\NewscoopBundle\Services $systemPreferences
Résultat Newscoop\NewscoopBundle\Services\SystemPreferencesService