noCache() public method
Disables query cache temporarily.
Queries performed within the callable will not use query cache at all. For example,
$db->cache(function (Connection $db) { // ... queries that use query cache ... return $db->noCache(function (Connection $db) { // this query will not use query cache return $db->createCommand('SELECT * FROM customer WHERE id=1')->queryOne(); }); });
See also:
public mixed noCache ( callable $callable ) | ||
---|---|---|
$callable | callable |
A PHP callable that contains DB queries which should not use query cache. The signature of the callable is |
return | mixed |
The return result of the callable |
throws | Exception |
if there is any exception during query |
Please login to continue.