Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
ElggCache Class Reference
Inheritance diagram for ElggCache:
ElggFileCache ElggSharedMemoryCache ElggMemcache ElggStaticVariableCache

Public Member Functions

 __construct ()
 Set the constructor. More...
 
 setVariable ($variable, $value)
 Set a cache variable. More...
 
 getVariable ($variable)
 Get variables for this cache. More...
 
 __get ($key)
 Class member get overloading, returning key using $this->load defaults. More...
 
 __set ($key, $value)
 Class member set overloading, setting a key using $this->save defaults. More...
 
 __isset ($key)
 Supporting isset, using $this->load() with default values. More...
 
 __unset ($key)
 Supporting unsetting of magic attributes. More...
 
 save ($key, $data)
 Save data in a cache. More...
 
 load ($key, $offset=0, $limit=null)
 Load data from the cache using a given key. More...
 
 delete ($key)
 Invalidate a key. More...
 
 clear ()
 Clear out all the contents of the cache. More...
 
 add ($key, $data)
 Add a key only if it doesn't already exist. More...
 
 offsetSet ($key, $value)
 Assigns a value for the specified key. More...
 
 offsetGet ($key)
 Get the value for specified key. More...
 
 offsetUnset ($key)
 Unsets a key. More...
 
 offsetExists ($key)
 Does key exist. More...
 

Detailed Description

Definition at line 9 of file ElggCache.php.

Constructor & Destructor Documentation

ElggCache::__construct ( )

Set the constructor.

Definition at line 20 of file ElggCache.php.

Member Function Documentation

ElggCache::__get (   $key)

Class member get overloading, returning key using $this->load defaults.

Parameters
string$keyName
Returns
mixed

Definition at line 62 of file ElggCache.php.

ElggCache::__isset (   $key)

Supporting isset, using $this->load() with default values.

Parameters
string$keyThe name of the attribute or metadata.
Returns
bool

Definition at line 85 of file ElggCache.php.

ElggCache::__set (   $key,
  $value 
)

Class member set overloading, setting a key using $this->save defaults.

Parameters
string$keyName
mixed$valueValue
Returns
void

Definition at line 74 of file ElggCache.php.

ElggCache::__unset (   $key)

Supporting unsetting of magic attributes.

Parameters
string$keyThe name of the attribute or metadata.
Returns
bool

Definition at line 96 of file ElggCache.php.

ElggCache::add (   $key,
  $data 
)

Add a key only if it doesn't already exist.

Implemented simply here, if you extend this class and your caching engine provides a better way then override this accordingly.

Parameters
string$keyName
string$dataValue
Returns
bool

Definition at line 150 of file ElggCache.php.

ElggCache::clear ( )
abstract

Clear out all the contents of the cache.

Returns
bool
ElggCache::delete (   $key)
abstract

Invalidate a key.

Parameters
string$keyName
Returns
bool
ElggCache::getVariable (   $variable)

Get variables for this cache.

Parameters
string$variableName
Returns
mixed The variable or null;

Definition at line 47 of file ElggCache.php.

ElggCache::load (   $key,
  $offset = 0,
  $limit = null 
)
abstract

Load data from the cache using a given key.

Parameters
string$keyName
int$offsetOffset
int$limitLimit
Returns
mixed The stored data or false.
ElggCache::offsetExists (   $key)

Does key exist.

See Also
::offsetExists()
Parameters
mixed$keyA key (offset) to check for.
Returns
bool

Definition at line 211 of file ElggCache.php.

ElggCache::offsetGet (   $key)

Get the value for specified key.

See Also
::offsetGet()
Parameters
mixed$keyThe key (offset) to retrieve.
Returns
mixed

Definition at line 183 of file ElggCache.php.

ElggCache::offsetSet (   $key,
  $value 
)

Assigns a value for the specified key.

See Also
::offsetSet()
Parameters
mixed$keyThe key (offset) to assign the value to.
mixed$valueThe value to set.
Returns
void

Definition at line 170 of file ElggCache.php.

ElggCache::offsetUnset (   $key)

Unsets a key.

See Also
::offsetUnset()
Parameters
mixed$keyThe key (offset) to unset.
Returns
void

Definition at line 196 of file ElggCache.php.

ElggCache::save (   $key,
  $data 
)
abstract

Save data in a cache.

Parameters
string$keyName
string$dataValue
Returns
bool
ElggCache::setVariable (   $variable,
  $value 
)

Set a cache variable.

Parameters
string$variableName
string$valueValue
Returns
void

Definition at line 32 of file ElggCache.php.


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