caching\DbCache exists()

exists() public method Checks whether a specified key exists in the cache. This can be faster than getting the value from the cache if the data is big. Note that this method does not check whether the dependency associated with the cached data, if there is any, has changed. So a call to get() may return false while exists returns true. public boolean exists ( $key )$key mixed A key identifying the cached value. This can be a simple string or a complex data structure consisting of factors

caching\DbCache deleteValue()

deleteValue() protected method Deletes a value with the specified key from cache This is the implementation of the method declared in the parent class. protected boolean deleteValue ( $key )$key string The key of the value to be deleted return boolean If no error happens during deletion

caching\DbCache $gcProbability

$gcProbability public property The probability (parts per million) that garbage collection (GC) should be performed when storing a piece of data in the cache. Defaults to 100, meaning 0.01% chance. This number should be between 0 and 1000000. A value 0 meaning no GC will be performed at all. public integer $gcProbability = 100

caching\DbCache $db

$db public property The DB connection object or the application component ID of the DB connection. After the DbCache object is created, if you want to change this property, you should only assign it with a DB connection object. Starting from version 2.0.2, this can also be a configuration array for creating the object. public yii\db\Connection|array|string $db = 'db'

caching\DbCache $cacheTable

$cacheTable public property Name of the DB table to store cache content. The table should be pre-created as follows: CREATE TABLE cache ( id char(128) NOT NULL PRIMARY KEY, expire int(11), data BLOB ); where 'BLOB' refers to the BLOB-type of your preferred DBMS. Below are the BLOB type that can be used for some popular DBMS: MySQL: LONGBLOB PostgreSQL: BYTEA MSSQL: BLOB When using DbCache in a production server, we recommend you create a DB index for the 'expire' column in the

caching\ChainedDependency getHasChanged()

getHasChanged() public method Performs the actual dependency checking. This method returns true if any of the dependency objects reports a dependency change. public boolean getHasChanged ( $cache )$cache yii\caching\Cache The cache component that is currently evaluating this dependency return boolean Whether the dependency is changed or not.

caching\ChainedDependency $dependencies

$dependencies public property List of dependencies that this dependency is composed of. Each array element must be a dependency object. public yii\caching\Dependency[] $dependencies = []

caching\ChainedDependency evaluateDependency()

evaluateDependency() public method Evaluates the dependency by generating and saving the data related with dependency. public void evaluateDependency ( $cache )$cache yii\caching\Cache The cache component that is currently evaluating this dependency

caching\ChainedDependency generateDependencyData()

generateDependencyData() protected method Generates the data needed to determine if dependency has been changed. This method does nothing in this class. protected mixed generateDependencyData ( $cache )$cache yii\caching\Cache The cache component that is currently evaluating this dependency return mixed The data needed to determine if dependency has been changed.

caching\ChainedDependency $dependOnAll

$dependOnAll public property Whether this dependency is depending on every dependency in $dependencies. Defaults to true, meaning if any of the dependencies has changed, this dependency is considered changed. When it is set false, it means if one of the dependencies has NOT changed, this dependency is considered NOT changed. public boolean $dependOnAll = true