From d4cb8525647e0b1427dae3fb16495afb6e77faa1 Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Wed, 15 May 2024 01:01:10 +0200 Subject: [PATCH] Added the `has` method --- app/Classes/MetadataManager.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Classes/MetadataManager.php b/app/Classes/MetadataManager.php index 05fac30..21b3417 100644 --- a/app/Classes/MetadataManager.php +++ b/app/Classes/MetadataManager.php @@ -147,6 +147,17 @@ public function get($key, $default = null, bool $respectDots = true) } } + /** + * Indicates if a particular key exists in metadata store. + * + * @param mixed $key The key of the value to retrieve. + * @return mixed The value of the specified key, or the default value. + */ + public function has($key) + { + return array_key_exists($key, $this->content); + } + /** * Retrieves all metadata as an associative array. *