소스 검색

Add an helper method to get the actual keys from the whole argument list.

Daniele Alessandri 14 년 전
부모
커밋
a386263d84
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      lib/Predis/Commands/ScriptedCommand.php

+ 8 - 0
lib/Predis/Commands/ScriptedCommand.php

@@ -13,4 +13,12 @@ abstract class ScriptedCommand extends ServerEval {
         }
         return array_merge(array($this->getScript(), $keys), $arguments);
     }
+
+    protected function getKeys() {
+        $arguments = $this->getArguments();
+        if (($keys = $this->keysCount()) === -1) {
+            return array_slice($arguments, 2);
+        }
+        return array_slice($arguments, 2, $keys);
+    }
 }