From b6ea99b75c423329701ec1280c8e239de7c55866 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 24 Apr 2020 18:08:12 +0200 Subject: [PATCH] Add function to check data --- Views/View.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Views/View.php b/Views/View.php index 2fe6f5182..e70f41baa 100644 --- a/Views/View.php +++ b/Views/View.php @@ -104,6 +104,20 @@ class View extends ViewAbstract $this->l11n = $response !== null ? $response->getHeader()->getL11n() : new Localization(); } + /** + * Check if data exists + * + * @param string $id Data Id + * + * @return bool + * + * @since 1.0.0 + */ + public function hasData(string $id) : bool + { + return isset($this->data[$id]); + } + /** * Get data attached to view *