Files
predis/lib/Predis/Commands/HashSetMultiple.php
T
2011-03-04 19:37:10 +01:00

20 lines
541 B
PHP

<?php
namespace Predis\Commands;
class HashSetMultiple extends Command {
public function getId() { return 'HMSET'; }
public function filterArguments(Array $arguments) {
if (count($arguments) === 2 && is_array($arguments[1])) {
$flattenedKVs = array($arguments[0]);
$args = $arguments[1];
foreach ($args as $k => $v) {
$flattenedKVs[] = $k;
$flattenedKVs[] = $v;
}
return $flattenedKVs;
}
return $arguments;
}
}