Gdn_SQLDriver::cache PHP Method

cache() public method

Set the cache key for this transaction
public cache ( string | array $Key, string $Operation = null, array $Options = null ) : Gdn_SQLDriver
$Key string | array The cache key (or array of keys) that this query will save into.
$Operation string The cache operation as a hint to the db.
$Options array The cache options as passed into Gdn_Cache::Store().
return Gdn_SQLDriver $this
    public function cache($Key, $Operation = null, $Options = null)
    {
        if (!$Key) {
            $this->_CacheKey = null;
            $this->_CacheOperation = null;
            $this->_CacheOptions = null;
            return $this;
        }
        $this->_CacheKey = $Key;
        if (!is_null($Operation)) {
            $this->_CacheOperation = $Operation;
        }
        if (!is_null($Options)) {
            $this->_CacheOptions = $Options;
        }
        return $this;
    }