Enhancement: support multiple GET parameters for the SORT command (see also my comment in ISSUE #1)

This commit is contained in:
Daniele Alessandri
2010-02-25 10:57:41 +01:00
parent f5f06d643f
commit 6e3b1c835d
+9 -1
View File
@@ -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];