class ClusterMap (View source)

Class ClusterMap

Creates and caches a map of classes and clusters in the database, which makes it possible to tell the proxy class of an entity just by it's rid.

Constants

CACHE_KEY

Properties

protected $cache
protected $binding
protected $map
protected $databaseName

Methods

__construct(BindingInterface $binding, Cache $cache)

No description

string
identifyClass(Rid $rid)

Tries to identify the class of an rid by matching it against the clusters in the database

array
getMap()

Loads/generates the map in case it's needed.

generateMap()

Creates the mapping of classes to clusters, it is public so it can be called forcibly which will be handy if it's done in some cache-warmup task.

load()

Tries to load the map from cache, otherwise generates it.

getCacheKey()

No description

Details

__construct(BindingInterface $binding, Cache $cache)

Parameters

BindingInterface $binding
Cache $cache

string identifyClass(Rid $rid)

Tries to identify the class of an rid by matching it against the clusters in the database

Parameters

Rid $rid

Return Value

string

Exceptions

MappingException

protected array getMap()

Loads/generates the map in case it's needed.

Return Value

array

generateMap()

Creates the mapping of classes to clusters, it is public so it can be called forcibly which will be handy if it's done in some cache-warmup task.

protected load()

Tries to load the map from cache, otherwise generates it.

protected getCacheKey()