From f1287a264febaa86522523bbe312e3bdb4c8944e Mon Sep 17 00:00:00 2001 From: "Mr.Web" Date: Tue, 19 Mar 2024 21:30:25 +0100 Subject: [PATCH] getMetaValue: improved to a single query --- src/Metable.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Metable.php b/src/Metable.php index 51a08ed..4433eaf 100644 --- a/src/Metable.php +++ b/src/Metable.php @@ -51,7 +51,11 @@ public function getMeta($key, $default = null) */ public function getMetaValue($key) { - return $this->hasMeta($key) ? $this->getMeta($key)->value : null; + if ($meta = $this->getMeta($key)) { + return $meta->value; + } + + return null; } /**