CommandInterface.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /*
  3. * This file is part of the Predis package.
  4. *
  5. * (c) Daniele Alessandri <suppakilla@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Predis\Command;
  11. /**
  12. * Defines an abstraction representing a Redis command.
  13. * @author Daniele Alessandri <suppakilla@gmail.com>
  14. */
  15. interface CommandInterface
  16. {
  17. /**
  18. * Gets the ID of a Redis command.
  19. *
  20. * @return string
  21. */
  22. public function getId();
  23. /**
  24. * Set the hash for the command.
  25. *
  26. * @param int $hash Calculated hash.
  27. */
  28. public function setHash($hash);
  29. /**
  30. * Returns the hash of the command.
  31. *
  32. * @return int
  33. */
  34. public function getHash();
  35. /**
  36. * Sets the arguments for the command.
  37. *
  38. * @param array $arguments List of arguments.
  39. */
  40. public function setArguments(Array $arguments);
  41. /**
  42. * Sets the raw arguments for the command without processing them.
  43. *
  44. * @param array $arguments List of arguments.
  45. */
  46. public function setRawArguments(Array $arguments);
  47. /**
  48. * Gets the arguments of the command.
  49. *
  50. * @return array
  51. */
  52. public function getArguments();
  53. /**
  54. * Parses a reply buffer and returns a PHP object.
  55. *
  56. * @param string $data Binary string containing the whole reply.
  57. * @return mixed
  58. */
  59. public function parseResponse($data);
  60. }