src/Transaction/MultiExec.php
public function watch($keys)
    {
        if (!$this->client->getProfile()->supportsCommand('WATCH')) {
            throw new NotSupportedException('WATCH is not supported by the current profile.');
        }

        if ($this->state->isWatchAllowed()) {
            throw new ClientException('Sending WATCH after MULTI is not allowed.');
        }

        $response = $this->call('WATCH', is_array($keys) ? $keys : array($keys));
        $this->state->flag(MultiExecState::WATCH);

        return $response;
    }
public function watch($keys)
    {
        if (!$this->client->getProfile()->supportsCommand('WATCH')) {
            throw new NotSupportedException('WATCH is not supported by the current profile.');
        }

        if ($this->state->isWatchAllowed()) {
            throw new ClientException('Sending WATCH after MULTI is not allowed.');
        }

        $response = $this->call('WATCH', is_array($keys) ? $keys : array($keys));
        $this->state->flag(MultiExecState::WATCH);

        return $response;
    }
public function watch ( $ keys ) { if ( ! $ this -> client -> getProfile ( ) -> supportsCommand ( 'WATCH' ) ) { throw new NotSupportedException ( 'WATCH is not supported by the current profile.' ) ; } if ( $ this -> state -> isWatchAllowed ( ) ) { throw new ClientException ( 'Sending WATCH after MULTI is not allowed.' ) ; } $ response = $ this -> call ( 'WATCH' , is_array ( $ keys ) ? $ keys : array ( $ keys ) ) ; $ this -> state -> flag ( MultiExecState :: WATCH ) ; return $ response ; }
Executes WATCH against one or more keys.

@param string|array $keys One or more keys.

@throws NotSupportedException
@throws ClientException

@return mixed
Executes WATCH against one or more keys .