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\DbDependency $params

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

caching\DbDependency $db

$db public property The application component ID of the DB connection. public string $db = 'db'

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 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 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 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 flushValues()

flushValues() protected method Deletes all values from cache. This is the implementation of the method declared in the parent class. protected boolean flushValues ( )return boolean Whether the flush operation was successful.

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