PHP Class Elgg\Cache\EntityCache

Afficher le fichier Open project: elgg/elgg Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( ElggSession $session, MetadataCache $metadata_cache ) Constructor
clear ( ) : void Clear the entity cache
disableCachingForEntity ( integer $guid ) : void Remove this entity from the entity cache and make sure it is not re-added
enableCachingForEntity ( integer $guid ) : void Allow this entity to be stored in the entity cache
get ( integer $guid ) : ElggEntity | false Retrieve a entity from the cache.
getByUsername ( string $username ) : ElggUser | false Returns cached user entity by username
remove ( integer $guid ) : void Invalidate this class's entry in the cache.
set ( ElggEntity $entity ) : void Cache an entity.

Method Details

__construct() public méthode

Constructor
public __construct ( ElggSession $session, MetadataCache $metadata_cache )
$session ElggSession Session
$metadata_cache MetadataCache MD cache

clear() public méthode

Clear the entity cache
public clear ( ) : void
Résultat void

disableCachingForEntity() public méthode

Remove this entity from the entity cache and make sure it is not re-added
public disableCachingForEntity ( integer $guid ) : void
$guid integer The entity guid
Résultat void

enableCachingForEntity() public méthode

Allow this entity to be stored in the entity cache
public enableCachingForEntity ( integer $guid ) : void
$guid integer The entity guid
Résultat void

get() public méthode

Retrieve a entity from the cache.
public get ( integer $guid ) : ElggEntity | false
$guid integer The GUID
Résultat ElggEntity | false false if entity not cached, or not fully loaded

getByUsername() public méthode

Returns cached user entity by username
public getByUsername ( string $username ) : ElggUser | false
$username string Username
Résultat ElggUser | false

remove() public méthode

Invalidate this class's entry in the cache.
public remove ( integer $guid ) : void
$guid integer The entity guid
Résultat void

set() public méthode

Cache an entity.
public set ( ElggEntity $entity ) : void
$entity ElggEntity Entity to cache
Résultat void