framework/db/Connection.php
public function noCache(callable $callable)
    {
        $this->_queryCacheInfo[] = false;
        try {
            $result = call_user_func($callable, $this);
            array_pop($this->_queryCacheInfo);
            return $result;
        } catch (\Exception $e) {
            array_pop($this->_queryCacheInfo);
            throw $e;
        } catch (\Throwable $e) {
            array_pop($this->_queryCacheInfo);
            throw $e;
        }
    }
public function noCache(callable $callable)
    {
        $this->_queryCacheInfo[] = false;
        try {
            $result = call_user_func($callable, $this);
            array_pop($this->_queryCacheInfo);
            return $result;
        } catch (\Exception $e) {
            array_pop($this->_queryCacheInfo);
            throw $e;
        } catch (\Throwable $e) {
            array_pop($this->_queryCacheInfo);
            throw $e;
        }
    }
public function noCache ( callable $ callable ) { $ this -> _queryCacheInfo [ ] = false ; try { $ result = call_user_func ( $ callable , $ this ) ; array_pop ( $ this -> _queryCacheInfo ) ; return $ result ; } catch ( \ Exception $ e ) { array_pop ( $ this -> _queryCacheInfo ) ; throw $ e ; } catch ( \ Throwable $ e ) { array_pop ( $ this -> _queryCacheInfo ) ; throw $ e ; } }
Disables query cache temporarily.

Queries performed within the callable will not use query cache at all. For example,

```php
$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();
});
});
```

@param callable $callable a PHP callable that contains DB queries which should not use query cache.
The signature of the callable is `function (Connection $db)`.
@return mixed the return result of the callable
@throws \Exception|\Throwable if there is any exception during query
@see enableQueryCache
@see queryCache
@see cache()
Disables query cache temporarily .