HSetNx.php 735 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace EasySwoole\Redis\CommandHandle;
  3. use EasySwoole\Redis\CommandConst;
  4. use EasySwoole\Redis\Redis;
  5. use EasySwoole\Redis\Response;
  6. class HSetNx extends AbstractCommandHandle
  7. {
  8. public $commandName = 'HSetNx';
  9. public function handelCommandData(...$data)
  10. {
  11. $key = array_shift($data);
  12. $this->setClusterExecClientByKey($key);
  13. $field = array_shift($data);
  14. $value = array_shift($data);
  15. $value = $this->serialize($value);
  16. $command = [CommandConst::HSETNX, $key, $field, $value];
  17. $commandData = array_merge($command, $data);
  18. return $commandData;
  19. }
  20. public function handelRecv(Response $recv)
  21. {
  22. return $recv->getData();
  23. }
  24. }