KeyPrefixProcessor.php 514 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Predis\Commands\Processors;
  3. use Predis\Commands\ICommand;
  4. class KeyPrefixProcessor implements ICommandProcessor
  5. {
  6. private $_prefix;
  7. public function __construct($prefix)
  8. {
  9. $this->setPrefix($prefix);
  10. }
  11. public function setPrefix($prefix)
  12. {
  13. $this->_prefix = $prefix;
  14. }
  15. public function getPrefix()
  16. {
  17. return $this->_prefix;
  18. }
  19. public function process(ICommand $command)
  20. {
  21. $command->prefixKeys($this->_prefix);
  22. }
  23. }