HashSetMultiple.php 541 B

12345678910111213141516171819
  1. <?php
  2. namespace Predis\Commands;
  3. class HashSetMultiple extends Command {
  4. public function getId() { return 'HMSET'; }
  5. public function filterArguments(Array $arguments) {
  6. if (count($arguments) === 2 && is_array($arguments[1])) {
  7. $flattenedKVs = array($arguments[0]);
  8. $args = $arguments[1];
  9. foreach ($args as $k => $v) {
  10. $flattenedKVs[] = $k;
  11. $flattenedKVs[] = $v;
  12. }
  13. return $flattenedKVs;
  14. }
  15. return $arguments;
  16. }
  17. }