KeyPrefixProcessor.php 498 B

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