mirror of
https://github.com/predis/predis.git
synced 2026-08-20 09:32:11 +00:00
23 lines
554 B
PHP
23 lines
554 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;
|
|
}
|
|
}
|