|
|
@@ -17,12 +17,12 @@ trait HashTrait
|
|
|
* @param string $attr
|
|
|
* @return string
|
|
|
*/
|
|
|
- public function get($word, string $attr): string
|
|
|
+ public function hget($word, string $attr): string
|
|
|
{
|
|
|
return TwRedis::hGet($this->key($word), $attr);
|
|
|
}
|
|
|
|
|
|
- public function gets($word, array $attrs): array
|
|
|
+ public function hmget($word, array $attrs): array
|
|
|
{
|
|
|
return TwRedis::hMGet($this->key($word), $attrs);
|
|
|
}
|
|
|
@@ -30,7 +30,7 @@ trait HashTrait
|
|
|
/**
|
|
|
* set hash attr
|
|
|
*/
|
|
|
- public function set($word, string $attr, $value): bool
|
|
|
+ public function hset($word, string $attr, $value): bool
|
|
|
{
|
|
|
if (is_array($value)) {
|
|
|
$value = json_encode($value);
|
|
|
@@ -44,7 +44,7 @@ trait HashTrait
|
|
|
* @param array $attrs: ['attr1'=>'value1', 'attr2' => 'value2']
|
|
|
* @return bool
|
|
|
*/
|
|
|
- public function sets($word, array $attrs): bool
|
|
|
+ public function hmset($word, array $attrs): bool
|
|
|
{
|
|
|
return TwRedis::hMSet($this->key($word), $attrs);
|
|
|
}
|
|
|
@@ -85,7 +85,7 @@ trait HashTrait
|
|
|
return TwRedis::hVals($this->key($word));
|
|
|
}
|
|
|
|
|
|
- public function dels($word, $attrs): int
|
|
|
+ public function hmdel($word, $attrs): int
|
|
|
{
|
|
|
if (is_string($attrs)) {
|
|
|
return TwRedis::hDel($this->key($word), $attrs);
|
|
|
@@ -94,7 +94,7 @@ trait HashTrait
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function getAll($word): array
|
|
|
+ public function hget_all($word): array
|
|
|
{
|
|
|
return TwRedis::hGetAll($this->key($word));
|
|
|
}
|