library/Rediska/Command/Get.php
public function create($keyOrKeys)
    {
        if (is_array($keyOrKeys)) {
            $this->_multi = true;
            $keys = $keyOrKeys;

            if (empty($keys)) {
                throw new Rediska_Command_Exception('Not present keys for get');
            }

            $sortedResult = array();
            $this->_keys = $keys;
            $connections = array();
            $keysByConnections = array();
            foreach ($keys as $key) {
                $connection = $this->_rediska->getConnectionByKeyName($key);
                $connectionAlias = $connection->getAlias();
                if (!array_key_exists($connectionAlias, $connections)) {
                    $connections[$connectionAlias] = $connection;
                    $keysByConnections[$connectionAlias] = array();
                }
                $keysByConnections[$connectionAlias][] = $key;
            }

            $result = array();
            $commands = array();
            foreach($keysByConnections as $connectionAlias => $keys) {
                $command = array('MGET');
                foreach($keys as $key) {
                    $command[] = $this->_rediska->getOption('namespace') . $key;
                    $this->_keysByConnections[] = $key;
                }
                $commands[] = new Rediska_Connection_Exec($connections[$connectionAlias], $command);
            }

            return $commands;
        } else {
            $key = $keyOrKeys;

            $connection = $this->_rediska->getConnectionByKeyName($key);

            $command = array('GET',
                             $this->_rediska->getOption('namespace') . $key);

            return new Rediska_Connection_Exec($connection, $command);
        }
    }
public function create($keyOrKeys)
    {
        if (is_array($keyOrKeys)) {
            $this->_multi = true;
            $keys = $keyOrKeys;

            if (empty($keys)) {
                throw new Rediska_Command_Exception('Not present keys for get');
            }

            $sortedResult = array();
            $this->_keys = $keys;
            $connections = array();
            $keysByConnections = array();
            foreach ($keys as $key) {
                $connection = $this->_rediska->getConnectionByKeyName($key);
                $connectionAlias = $connection->getAlias();
                if (!array_key_exists($connectionAlias, $connections)) {
                    $connections[$connectionAlias] = $connection;
                    $keysByConnections[$connectionAlias] = array();
                }
                $keysByConnections[$connectionAlias][] = $key;
            }

            $result = array();
            $commands = array();
            foreach($keysByConnections as $connectionAlias => $keys) {
                $command = array('MGET');
                foreach($keys as $key) {
                    $command[] = $this->_rediska->getOption('namespace') . $key;
                    $this->_keysByConnections[] = $key;
                }
                $commands[] = new Rediska_Connection_Exec($connections[$connectionAlias], $command);
            }

            return $commands;
        } else {
            $key = $keyOrKeys;

            $connection = $this->_rediska->getConnectionByKeyName($key);

            $command = array('GET',
                             $this->_rediska->getOption('namespace') . $key);

            return new Rediska_Connection_Exec($connection, $command);
        }
    }
Create command

@param string|array $keyOrKeys Key name or array of names
@return Rediska_Connection_Exec