mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
Enhancement: support multiple GET parameters for the SORT command (see also my comment in ISSUE #1)
This commit is contained in:
+9
-1
@@ -1461,7 +1461,15 @@ class Sort extends \Predis\InlineCommand {
|
||||
$query[] = 'BY ' . $sortParams['by'];
|
||||
}
|
||||
if (isset($sortParams['get'])) {
|
||||
$query[] = 'GET ' . $sortParams['get'];
|
||||
$getargs = $sortParams['get'];
|
||||
if (is_array($getargs)) {
|
||||
foreach ($getargs as $getarg) {
|
||||
$query[] = 'GET ' . $getarg;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$query[] = 'GET ' . $getargs;
|
||||
}
|
||||
}
|
||||
if (isset($sortParams['limit']) && is_array($sortParams['limit'])) {
|
||||
$query[] = 'LIMIT ' . $sortParams['limit'][0] . ' ' . $sortParams['limit'][1];
|
||||
|
||||
Reference in New Issue
Block a user