Skip to content

Commit de5fc17

Browse files
committed
keepInCache control for QueryCachePolicy
1 parent 0118438 commit de5fc17

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/Session.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ class Session
6565
*/
6666
protected $is_alive = false;
6767

68+
/**
69+
* @var bool
70+
*/
71+
protected $keep_query_in_cache = false;
72+
6873
/**
6974
* @param Table $table
7075
* @param string $session_id
@@ -295,6 +300,17 @@ public function rollBack()
295300
return $this->rollbackTransaction();
296301
}
297302

303+
/**
304+
* Set whether to keep query in cache.
305+
*
306+
* @return $this
307+
*/
308+
public function keepInCache($value = true)
309+
{
310+
$this->keep_query_in_cache = (bool)$value;
311+
return $this;
312+
}
313+
298314
/**
299315
* @param string $yql
300316
* @param array|null $parameters
@@ -326,7 +342,9 @@ public function query($yql, array $parameters = null)
326342
// 'commit_tx' => true,
327343
]);
328344

329-
$query_cache_policy = new QueryCachePolicy;
345+
$query_cache_policy = new QueryCachePolicy([
346+
'keep_in_cache' => $this->keep_query_in_cache,
347+
]);
330348

331349
$data = [
332350
'session_id' => $this->session_id,

0 commit comments

Comments
 (0)