Преглед изворни кода

Enhancement: allows method chaining with commands pipelines.

Daniele Alessandri пре 15 година
родитељ
комит
47d34531e3
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      lib/Predis.php

+ 3 - 0
lib/Predis.php

@@ -412,6 +412,7 @@ class CommandPipeline {
     public function __call($method, $arguments) {
     public function __call($method, $arguments) {
         $command = $this->_redisClient->createCommand($method, $arguments);
         $command = $this->_redisClient->createCommand($method, $arguments);
         $this->recordCommand($command);
         $this->recordCommand($command);
+        return $this;
     }
     }
 
 
     private function recordCommand(Command $command) {
     private function recordCommand(Command $command) {
@@ -438,6 +439,8 @@ class CommandPipeline {
             $this->_returnValues[] = $connection->readResponse($commands[$i]);
             $this->_returnValues[] = $connection->readResponse($commands[$i]);
             unset($commands[$i]);
             unset($commands[$i]);
         }
         }
+
+        return $this;
     }
     }
 
 
     private function setRunning($bool) {
     private function setRunning($bool) {