From 1216addd1fc06a67ce3cc64234cd06cbcbbf5dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 16 Aug 2019 17:55:40 +0200 Subject: [PATCH] Improve get() --- src/TenantManager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TenantManager.php b/src/TenantManager.php index 37c9e716..1409a36f 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -273,6 +273,10 @@ final class TenantManager { $uuid = $uuid ?: $this->tenant['uuid']; + if (isset($this->tenant['uuid']) && $uuid === $this->tenant['uuid'] && isset($this->tenant[$key])) { + return $this->tenant[$key]; + } + if (\is_array($key)) { return $this->jsonDecodeArrayValues($this->storage->getMany($uuid, $key)); } @@ -372,6 +376,6 @@ final class TenantManager return $this->tenant; } - return $this->tenant[(string) $attribute]; + return $this->get((string) $attribute); } }