Elgg  Version 2.3
Public Member Functions | Public Attributes | List of all members
Elgg\Cache\EntityCache Class Reference

Volatile cache for entities. More...

Public Member Functions

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

Public Attributes

const MAX_SIZE = 256
 

Detailed Description

Volatile cache for entities.

private

Definition at line 12 of file EntityCache.php.

Constructor & Destructor Documentation

Elgg\Cache\EntityCache::__construct ( ElggSession  $session,
MetadataCache  $metadata_cache 
)

Constructor.

Parameters
ElggSession$sessionSession
MetadataCache$metadata_cacheMD cache

Definition at line 48 of file EntityCache.php.

Member Function Documentation

Elgg\Cache\EntityCache::clear ( )

Clear the entity cache.

Returns
void

Definition at line 157 of file EntityCache.php.

Elgg\Cache\EntityCache::disableCachingForEntity (   $guid)

Remove this entity from the entity cache and make sure it is not re-added.

Parameters
int$guidThe entity guid
Returns
void

Definition at line 172 of file EntityCache.php.

Elgg\Cache\EntityCache::enableCachingForEntity (   $guid)

Allow this entity to be stored in the entity cache.

Parameters
int$guidThe entity guid
Returns
void

Definition at line 183 of file EntityCache.php.

Elgg\Cache\EntityCache::get (   $guid)

Retrieve a entity from the cache.

Parameters
int$guidThe GUID
Returns
|false false if entity not cached, or not fully loaded

Definition at line 62 of file EntityCache.php.

Elgg\Cache\EntityCache::getByUsername (   $username)

Returns cached user entity by username.

Parameters
string$usernameUsername
Returns
|false

Definition at line 80 of file EntityCache.php.

Elgg\Cache\EntityCache::remove (   $guid)

Invalidate this class's entry in the cache.

Parameters
int$guidThe entity guid
Returns
void

Definition at line 128 of file EntityCache.php.

Elgg\Cache\EntityCache::set ( ElggEntity  $entity)

Cache an entity.

Parameters
ElggEntity$entityEntity to cache
Returns
void

Definition at line 93 of file EntityCache.php.

Member Data Documentation

const Elgg\Cache\EntityCache::MAX_SIZE = 256

Definition at line 15 of file EntityCache.php.


The documentation for this class was generated from the following file: