caching\DbDependency $params

$params public property The parameters (name => value) to be bound to the SQL statement specified by $sql. public array $params = []

caching\DbDependency generateDependencyData()

generateDependencyData() protected method Generates the data needed to determine if dependency has been changed. This method returns the value of the global state. 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. throws yii\base\InvalidConfigException if $db is not a valid application component ID

caching\DbDependency $sql

$sql public property The SQL query whose result is used to determine if the dependency has been changed. Only the first row of the query result will be used. public string $sql = null

caching\DbCache setValue()

setValue() protected method Stores a value identified by a key in cache. This is the implementation of the method declared in the parent class. protected boolean setValue ( $key, $value, $duration )$key string The key identifying the value to be cached $value string The value to be cached. Other types (if you have disabled $serializer) cannot be saved. $duration integer The number of seconds in which the cached value will expire. 0 means never expire. return boolean True if the val

caching\DbCache getValues()

getValues() protected method Retrieves multiple values from cache with the specified keys. protected array getValues ( $keys )$keys array A list of keys identifying the cached values return array A list of cached values indexed by the keys

caching\DbCache init()

init() public method Initializes the DbCache component. This method will initialize the $db property to make sure it refers to a valid DB connection. public void init ( )throws yii\base\InvalidConfigException if $db is invalid.

caching\DbCache getValue()

getValue() protected method Retrieves a value from cache with a specified key. This is the implementation of the method declared in the parent class. protected string|false getValue ( $key )$key string A unique key identifying the cached value return string|false The value stored in cache, false if the value is not in the cache or expired.

caching\DbCache gc()

gc() public method Removes the expired data values. public void gc ( $force = false )$force boolean Whether to enforce the garbage collection regardless of $gcProbability. Defaults to false, meaning the actual deletion happens with the probability as specified by $gcProbability.

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 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