KeyDelete.php 633 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Predis\Commands;
  3. use Predis\Helpers;
  4. class KeyDelete extends Command
  5. {
  6. public function getId()
  7. {
  8. return 'DEL';
  9. }
  10. protected function filterArguments(Array $arguments)
  11. {
  12. return Helpers::filterArrayArguments($arguments);
  13. }
  14. protected function onPrefixKeys(Array $arguments, $prefix)
  15. {
  16. return PrefixHelpers::multipleKeys($arguments, $prefix);
  17. }
  18. protected function canBeHashed()
  19. {
  20. $args = $this->getArguments();
  21. if (count($args) === 1) {
  22. return true;
  23. }
  24. return $this->checkSameHashForKeys($args);
  25. }
  26. }