Overview

Support class for models to work with with a Solar_Cache object.

This cache works slightly differently from "normal" caches, in that it tracks a version number for the data in the source table. When you "delete" the cache, what really happens is that the version number increases. This makes it particularly effective for memcache and other memory-based caches, where old entries simply "drop out" when there's no more room.

This cache is not recommended for file-based caching. If you use a file-based cache here, be prepared to clear out old data versions on your own, as this system will not do it for you.

For background information on cache versioning, see the blog entry at » http://blog.leetsoft.com/2007/5/22/the-secret-to-memcached.

Package

This class is part of the Solar_Sql_Model package.

Inheritance:

Configuration Keys

  • cache: A Solar_Cache dependency.

Constants

None.

Public Properties

The Solar_Sql_Model_Cache class has no public properties; try the list of all properties.

Public Methods

These are all the public methods in the Solar_Sql_Model_Cache class.

You can also view the list of all public, protected, and private methods.

__construct()

Constructor.

__destruct()

Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().

add()

Adds data to the cache under a specified key.

delete()

Deletes the cache for this model.

deleteAll()

Deletes the cache for this model and all related models.

dump()

Convenience method for getting a dump the whole object, or one of its properties, or an external variable.

entry()

Gets the key for a cache entry based on fetch parameters for a select.

fetch()

Fetches the data for a cache entry.

locale()

Looks up class-specific locale strings based on a key.

setModel()

Sets the model this cache will work with; picks up the SQL cache key prefix along with it.



Local