mirror of
https://github.com/predis/predis.git
synced 2026-08-24 15:49:28 +00:00
21 lines
505 B
PHP
21 lines
505 B
PHP
<?php
|
|
|
|
namespace Predis\Commands;
|
|
|
|
use Predis\Command;
|
|
use Predis\Iterators\MultiBulkResponseTuple;
|
|
|
|
class HashGetAll extends Command {
|
|
public function getCommandId() { return 'HGETALL'; }
|
|
public function parseResponse($data) {
|
|
if ($data instanceof \Iterator) {
|
|
return new MultiBulkResponseTuple($data);
|
|
}
|
|
$result = array();
|
|
for ($i = 0; $i < count($data); $i++) {
|
|
$result[$data[$i]] = $data[++$i];
|
|
}
|
|
return $result;
|
|
}
|
|
}
|