From e6c0db9ee1b9acc5781cf90df58dbf173fa52b90 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 15 Nov 2021 17:07:32 +0000 Subject: [PATCH] [CORE][Cache] Allow retrieving multiple keys from a hashmap --- src/Core/Cache.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Core/Cache.php b/src/Core/Cache.php index 96935f80c3..4ad0a8ebc3 100644 --- a/src/Core/Cache.php +++ b/src/Core/Cache.php @@ -318,10 +318,14 @@ abstract class Cache } } - public static function getHashMapKey(string $map_key, string $key, string $pool = 'default') + public static function getHashMapKey(string $map_key, string|array $key, string $pool = 'default') { if (isset(self::$redis[$pool])) { - return self::$redis[$pool]->hget($map_key, $key); + if (\is_string($key)) { + return self::$redis[$pool]->hget($map_key, $key); + } else { + return self::$redis[$pool]->hmget($map_key, $key); + } } else { throw new NotImplementedException; }