Skip to content

Commit fe81752

Browse files
committed
readTable options: limit, ordered
1 parent 5930ffd commit fe81752

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

src/Session.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,28 @@ public function prepare($yql)
436436
/**
437437
* @param string $path
438438
* @param array $columns
439+
* @param array $options
439440
* @return \Generator
440441
*/
441-
public function readTable($path, $columns = [])
442+
public function readTable($path, $columns = [], $options = [])
442443
{
443-
return $this->streamRequest('StreamReadTable', [
444+
$params = [
444445
'session_id' => $this->session_id,
445446
'path' => $this->pathPrefix($path),
446447
'columns' => $columns,
447-
]);
448+
];
449+
450+
if (isset($options['row_limit']))
451+
{
452+
$params['row_limit'] = (int)$options['row_limit'];
453+
}
454+
455+
if (isset($options['ordered']))
456+
{
457+
$params['ordered'] = (bool)$options['ordered'];
458+
}
459+
460+
return $this->streamRequest('StreamReadTable', $params);
448461
}
449462

450463
/**

src/Table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,12 @@ public function prepare($yql)
261261
*
262262
* @param string $path
263263
* @param array $columns
264+
* @param array $options
264265
* @return \Generator
265266
*/
266-
public function readTable($path, $columns = [])
267+
public function readTable($path, $columns = [], $options = [])
267268
{
268-
return $this->session()->readTable($path, $columns);
269+
return $this->session()->readTable($path, $columns, $options);
269270
}
270271

271272
/**

0 commit comments

Comments
 (0)